Tags: dragonwasrobot/json-schema-to-elm
Tags
Updates json_schema dependency to 0.2.0 Given that `json_schema` has breaking changes in the way it handles references, such that both local and global references are now handled with the `URI` type, this has required minor changes in all of the printer modules, and as a result I've decided to bump the minor version of json-schema-to-elm given the scope of affected files. However, this change should make things easier going forward when implementing new feature.
Printers review (#66) This PR fixes decoders/encoders for `allOf` and `anyOf` types, sanitises identifier names, various bug fixes, refactorings and dialyzer fixes. * Fixes and refactors the `allOf` and `anyOf` printers, such that they produce correct Elm code for decoding and encoding `all_of` and `any_of` JSON schema nodes. * Sanitises / Elmifies JSON schema identifiers, such that the Elm code output is valid Elm - Moves indentation- and naming-specific logic from `printer/util.ex` into a new `printer/utils` folder, - adjusts all printers to now use the `Naming.normalize_identifier()` function before sending identifier names to Elm code templates, and - adds tests for the 'sanitise identifier' feature. * Splits the `JS2E.Printer.Util` module into a whole `printer/utils` folder in order to increase cohesion, i.e. have one util module per relevant area of printing. * Fixes all dialyzer errors except for allOf/anyOf/oneOf printers * Improves documentation - Updates 'allOf' and 'anyOf' type descriptions to reflect new Elm decoders/encoders, - updates `README.md` to include a section on `js2e` error reporting, and - creates a `CONTRIBUTING.md` file, detailing what potential contributors should know before filing issues/PRs.
Error reporting (#48) Adds Elm-style error reporting to js2e - Streamlines error handling across all files using `ParserResult` and `PrinterResult` types, which encapsulate the result of parsing/printing a schema and any warnings/errors encountered along the way, - adds parser and printer error util modules for pretty printing errors, - moves the logic from Predicates.ex into their respective parser files, - moves schema version logic into its own module, - splits most of parser.ex into root parser and parser util, - adds missing 'properties', 'anyOf', 'items', etc. to `TypePath`s, - updates README, and - Closes #23
Qualified references (#43) Closes #39 by adding fully qualified names in the generated Elm code when referencing definitions from other modules. * Adds 'module' to schema definitions, * passes the schema definition context - instead of the type dictionary - to each printer function, * uses fully qualified names when referencing types, encoders and decoders from other modules in the generated Elm code, * removes the explicit import of types, decoders and encoders from other modules in the generated Elm code. Now just import the module and nothing else, * adds support for the 'title' property in the schema root object, * removes some code redundancy, and * updates readme with new elm output.
PreviousNext