Skip to content

Sanitised identifiers + all_of/any_of support

Compare
Choose a tag to compare
@dragonwasrobot dragonwasrobot released this 29 Apr 15:09
· 125 commits to master since this release
0cd9f0d

Sanitise identifiers, better all_of / any_of support, and a large refactoring

  • 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.
  • 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.

  • Adds contexts 'parser' and 'printer'

We isolate all parser related code in the parser folder and expose the
parser.ex module as the interface for that folder / context.

We repeat this exercise for the printer folder / context.

Furthermore, we remove all the import statements and replace them with more
explicit aliases.

  • 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.