Open austinh opened 5 years ago
Do you have a proposal for how to translate a JSON schema containing patternProperties
into an OAS3 schema object? All I can think of doing is forcing additionalProperties
to true
.
Interestingly the conversion package json-schema-to-openapi-schema already says it does that:
https://github.com/wework/json-schema-to-openapi-schema/blob/master/test/pattern_properties.test.js
Austin I’ll grab the spec and mush it through the test suite to see what happens. Thank you!
Right now, referencing a json-schema that uses "patternProperties" seems to cause a linter error. Would be great if this standard (draft 4) feature was supported without throwing errors. This is currently not supported by openapi 3, but if you use json-schema through https://github.com/wework/json-schema-to-openapi-schema, you need this property.
Detailed description
Here's an example of a json schema that will cause speccy to error:
Context
I am currently using jsonapi's json-schema: https://jsonapi.org/schema and this schema uses patternProperties. This is very helpful when documenting a jsonapi to take use of the allOf inheritance pattern and conform to jsonapi.
Your environment
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.