Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Releases: raml-org/ramldt2jsonschema

v1.2.3

17 Jul 07:22
Compare
Choose a tag to compare

Improved/bugfixed Windows paths handling.

v1.2.2

17 Jul 06:23
Compare
Choose a tag to compare

Updated dependencies.

Changes in 1.2.1

09 Jul 07:28
0e23afa
Compare
Choose a tag to compare

Updated dependencies.

Changes in 1.2.0

06 May 06:30
Compare
Choose a tag to compare
  • Updated dependencies
  • Dropped Node 8 support

Changes in v1.1.1

10 Mar 10:34
Compare
Choose a tag to compare

Updated dependencies:

Changes in 1.1.0

02 Dec 08:28
Compare
Choose a tag to compare

Fixed:

  • dt2js does not always output a $schema property #106.

New features:

  • Added --validate option to dt2js util which enables output JSON Schema validation with Ajv. Please see this readme section for more details.
  • Added --validate option to js2dt util which enables output RAML validation with webapi-parser. Please see this readme section for more details.

Dependencies:

  • Fixed security issues related to npm packages dependencies.
  • Update webapi-parser version to 0.4.0.

1.0.0

23 Sep 09:29
Compare
Choose a tag to compare

This release improves ramldt2jsonschema by adding several new features, and by addressing a number of issues. This became possible, in great part, thanks to switching to the new official RAML parser: webapi-parser.

Changes

  • The dt2js and js2dt functions are now both asynchronous (using async/await);
  • The setBasePath() function was removed in favor of the basePath argument. See this section of the README for more details;
  • Each converters' list of limitations has also changed. See this other section of the README for an up-to-date list;
  • A new --draft option was added to dt2js CLI. It allows specifying the output JSON Schema draft version. Supported values are: 04, 06 and 07 (default).

Note that the output of both dt2js and js2dt has changed (more details below).

Old vs new dt2js output comparison

- old
+ new

Structural differences

- draft-06 schema
+ draft-07 schema (or 04, 06)

- super-flat json, bubbling `anyOf` from unions to the very top of the schema
+ transforms unions using `anyOf` and keeps it at the original depth/place

- schema defined in the root of json document
+ defines schema in `definitions` and uses `$ref`

Low-level differences

- all types of dates converted to string with long patterns
+ all types of dates converted to string with "format"

- number with "format: int32" not changed
+ number with "format: int32" converted to type: integer

- object property's "facets" converted
+ object property's "facets" not converted

- converted union of arrays incorrectly
+ converts union of arrays correctly
(see Cat.properties.proscons)

- converted example "displayName" to "title"
+ keeps the "displayName" property

- pattern regex kept as is
+ pattern regex wrapped in `^...$`

Old vs new js2dt comparison

- old
+ new

Structural differences

None.

Low-level differences

- did not convert properties: minProperties, maxProperties, discriminator, items, uniqueItems, maxItems, minItems, enum, format (in numbers), xml, default, example, multipleOf
+ does convert mentioned properties

- optional properties were marked with a trailing "?"
+ optional properties are marked with "required: false"

- used types' names to specify property type
+ always uses "type:" keyword and inline type declaration

- converted dates with a "pattern" property to specific RAML dates types (e.g. datetime-only)
+ converts dates to strings with "pattern" property

- converted string with "media" to "type: file"
+ converts it incorrectly (stays a string)

Fix path resolution and silent errors

02 Nov 03:37
Compare
Choose a tag to compare

Fixed

  • Silent error when parsing included files #61
  • Wrong path resolution when using nested inclusions/uses
  • Wrong required with object and examples #65

Support for JSON Schema URL $ref

08 Jun 17:34
Compare
Choose a tag to compare

Added

  • support for remote $ref in js2dt #58

Fixed

  • "ramlTypeName" should be optional in js2dt #59

Support for JSON Schema draft-6

17 May 17:49
Compare
Choose a tag to compare

Added

  • support JSON schema draft-6 #22
  • add integration tests to CI/mocha #39
  • add ability for js2dt to produce a RAML DataType #30

Fixed

  • setBasePath form example doesn't work. #48