Closed Shockolate closed 1 year ago
Just as a note: JSON schema v4 does allow properties which are not valid JSON schema v4 keywords (such as OpenAPI's x-*
properties): https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.2
But it could be useful for people that want to opt-in to get rid of them!
Oh! I did not know that, @ehmicky , thanks.
I'll leave it up to @mikunn to merge or deny.
I think it would still be useful as an opt-in for users that want cleaner JSON schemas.
I merged this in with my fork and it was throwing up errors:
✖ should be equivalent
-----------------------
operator: deepEqual
expected: |-
{ $schema: 'http://json-schema.org/draft-04/schema#', type: 'object', properties: { boolProperty: { type: 'boolean', 'x-extension-property': true }, 'x-extension-property': true }, 'x-extension-property': true }
actual: |-
{ type: 'object', properties: { boolProperty: { type: 'boolean', 'x-extension-property': true } }, 'x-extension-property': true, $schema: 'http://json-schema.org/draft-04/schema#' }
at: Test.<anonymous> (/Users/phil/src/openapi-contrib/openapi-schema-to-json-schema/test/extension_properties.test.js:64:10)
stack: |-
Error: should be equivalent
fancy fixing it and making a new PR over here? https://github.com/openapi-contrib/openapi-schema-to-json-schema
Deletes unsupported Swagger Extensions properties when converting to JSON Schema.