This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
Releases: raml-org/ramldt2jsonschema
Releases · raml-org/ramldt2jsonschema
v1.2.3
v1.2.2
Changes in 1.2.1
Updated dependencies.
Changes in 1.2.0
- Updated dependencies
- Dropped Node 8 support
Changes in v1.1.1
Changes in 1.1.0
Fixed:
dt2js
does not always output a$schema
property #106.
New features:
- Added
--validate
option todt2js
util which enables output JSON Schema validation with Ajv. Please see this readme section for more details. - Added
--validate
option tojs2dt
util which enables output RAML validation withwebapi-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
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
andjs2dt
functions are now both asynchronous (usingasync/await
); - The
setBasePath()
function was removed in favor of thebasePath
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 todt2js
CLI. It allows specifying the output JSON Schema draft version. Supported values are:04
,06
and07
(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)