openapi-transformer-toolkit
openapi-transformer-toolkit copied to clipboard
[oas2tson] generate schema from any OpenAPI prop
It would be useful to generate schemas not only from components.schemas but from any OpenApi property (especially paths where endpoints are documented). This opens up further complexity because OpenApi parameters are not JSON schema (however, there is a library for that)
@toomuchdesign what is the library that does that? Also, can you provide an example of what you would expect as an output?
I've used https://www.npmjs.com/package/openapi-jsonschema-parameters. It transforms parameters array into a record object (see docs example).
openapi-schema-to-json-schema offers a lower level fromParameter utility to convert specific parameters array entries.