You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- deletes `nullable` and adds `"null"` to `type` array if `nullable` is `true`
24
-
- supports deep structures with nested `allOf`s etc.
25
-
- removes [OpenAPI specific properties](https://spec.openapis.org/oas/v3.0.3.html#fixed-fields-20) such as `discriminator`, `deprecated` etc. unless specified otherwise
26
-
- optionally supports `patternProperties` with `x-patternProperties` in the Schema Object
* deletes `nullable` and adds `"null"` to `type` array if `nullable` is `true`
24
+
* supports deep structures with nested `allOf`s etc.
25
+
* removes [OpenAPI specific properties](https://spec.openapis.org/oas/v3.0.3.html#fixed-fields-20) such as `discriminator`, `deprecated` etc. unless specified otherwise
26
+
* optionally supports `patternProperties` with `x-patternProperties` in the Schema Object
27
27
28
28
**NOTE**: `$ref`s are not handled in any way, so please use a resolver such as [json-schema-ref-parser](https://github.com/APIDevTools/json-schema-ref-parser) or [swagger-cli bundle](https://www.npmjs.com/package/swagger-cli) prior to using this package.
var toJsonSchema =require("@openapi-contrib/openapi-schema-to-json-schema");
41
+
42
+
var toJsonSchema =require('@openapi-contrib/openapi-schema-to-json-schema');
42
43
43
44
var schema = {
44
-
type:"string",
45
-
format:"date-time",
46
-
nullable:true,
45
+
type:'string',
46
+
format:'date-time',
47
+
nullable:true
47
48
};
48
49
49
50
var convertedSchema =toJsonSchema(schema);
@@ -79,8 +80,8 @@ For example
79
80
80
81
```js
81
82
var schema = {
82
-
type:"string",
83
-
format:"date",
83
+
type:'string',
84
+
format:'date'
84
85
};
85
86
86
87
var convertedSchema =toJsonSchema(schema, { dateToDateTime:true });
@@ -122,63 +123,21 @@ If the handler is not provided, the default handler is used. If `additionalPrope
122
123
123
124
See `test/pattern_properties.test.js` for examples how this works.
124
125
125
-
#### `definitionKeywords` (array)
126
-
127
-
By default, definitions are not converted. If your documents follow the convention of having a definitions object at the root of a (sub)schema, you can set definitionKeywords to `['definitions']`.
Copyright 2021 the [OpenAPI Contrib organization](https://github.com/openapi-contrib). Code released under the [MIT License](https://github.com/openapi-contrib/openapi-schema-to-json-schema/blob/main/LICENSE).
0 commit comments