Skip to content

Tags: dragonwasrobot/json-schema-to-elm

Tags

v2.9.1

Toggle v2.9.1's commit message
Tagging v2.9.1

v2.9.0

Toggle v2.9.0's commit message
Tagging v2.9.0

v2.8.1

Toggle v2.8.1's commit message
Documents: Bumps minor version

v2.8.0

Toggle v2.8.0's commit message
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.

v2.7.0

Toggle v2.7.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Updates generated code to Elm 0.19 (#74)

* Updates generated code to Elm 0.19

Now generates Elm 0.19 code, without any option for generating
backwards compatible Elm 0.18 code.

In the process, some dependencies and the README have been updated.

v2.6.0

Toggle v2.6.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Updates version in mix.exs

v2.5.0

Toggle v2.5.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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.

v2.4.0

Toggle v2.4.0's commit message
Adds support for nested module names, closes #24

v2.3.0

Toggle v2.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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

v2.2.0

Toggle v2.2.0's commit message
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.