openapi-transformer-toolkit icon indicating copy to clipboard operation
openapi-transformer-toolkit copied to clipboard

[oas2tson] generate schema from any OpenAPI prop

Open simoneb opened this issue 1 year ago • 2 comments

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)

simoneb avatar Apr 15 '24 15:04 simoneb

@toomuchdesign what is the library that does that? Also, can you provide an example of what you would expect as an output?

simoneb avatar Apr 25 '24 14:04 simoneb

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.

toomuchdesign avatar Apr 26 '24 08:04 toomuchdesign