Skip to content

Releases: cchandurkar/json-schema-to-case-class

Release v1.6.1

09 Apr 23:20
2e49b0b
Compare
Choose a tag to compare
  • Added a CLI
  • Install the package globally and run:
js2cc --help

Or use with npx

npx js2cc --help

CLI Options:

Usage: js2cc <src> [options]

Convert JSON schemas into scala case class

Arguments:
  src                                       Path to json schema. It must be a local file. Support for reading URLs will be added in future version.

Options:
  -v, --version                             Library version
  -d, --max-depth <number>                  Maximum depth to parse nested JSON schema (default: 0)
  -s, --option-setting <type>               Wrap non-required fields in `Option` (choices: "noOptions", "useOptions", "useOptionsForAll", default: "useOptions")
  -n, --top-level-case-class-name <string>  Name of the top-level case class (Applies only if JSON schema does not have top-level `title` property. (default: "MyCaseClass")
  -d, --default-generic-type <string>       Default generic type for unparsable data types (default: "Any")
  -p, --parse-refs                          Parse local and remote references (default: true)
  -c, --generate-comments                   Generate scaladoc comments (default: false)
  -v, --generate-validations                Generate assertions from validations in JSON schema (default: false)
  -e, --generate-enumerations               Generate enumerations (default: false)
  -o, --output <string>                     File name to write output to. If not provided, output will be written to console. (default: false)
  -D, --debug                               Write more detailed output to console (default: false)
  -h, --help                                display help for command

Example call:
  $ js2cc ./local/sample-schema.json -n Person -s useOptions -o sample-output.scala --debug

Release v1.3.1

21 Jan 21:59
c3f0f4d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.2.0...v1.3.1

Release v1.2.0

02 Mar 08:16
d73512a
Compare
Choose a tag to compare

Added Support for Enumerations.

Release v1.1.11

25 Feb 23:26
d07629f
Compare
Choose a tag to compare
Merge pull request #21 from cchandurkar/develop

Release v1.1.11

Release v1.1.10

25 Feb 08:30
6520b96
Compare
Choose a tag to compare
  1. Use Scala's Int type instead of Integer
  2. Support validations through assertions in case class body

Release v1.1.9

21 Feb 23:45
b3c0773
Compare
Choose a tag to compare
  • Remove dead code
  • Fix the maxDepth config bug
  • Fix the Option[] wrap bug
  • Updated README with conversion example
  • 1.1.9

Release v1.1.8

21 Feb 07:37
535cd10
Compare
Choose a tag to compare

Fix text case default typo

Release v1.1.7

21 Feb 07:09
4361aea
Compare
Choose a tag to compare
Release v1.1.7 (#11)

* Remove postinstall scripts

* 1.1.7

Release v1.1.6

21 Feb 07:09
13ecc68
Compare
Choose a tag to compare

Initial Release