Releases: cchandurkar/json-schema-to-case-class
Releases · cchandurkar/json-schema-to-case-class
Release v1.6.1
- 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
What's Changed
- Added support for
allOf
by @cchandurkar in #27 - Use the v16 node version for build by @cchandurkar in #28
Full Changelog: v1.2.0...v1.3.1
Release v1.2.0
Added Support for Enumerations.
Release v1.1.11
Merge pull request #21 from cchandurkar/develop Release v1.1.11
Release v1.1.10
- Use Scala's Int type instead of Integer
- Support validations through assertions in case class body
Release v1.1.9
- 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
Fix text case default typo
Release v1.1.7
Release v1.1.7 (#11) * Remove postinstall scripts * 1.1.7
Release v1.1.6
Initial Release