This directory demonstrates how to use openapi-tools with the Swagger Pet Store specification.
The Pet Store spec is available at:
https://raw.githubusercontent.com/readmeio/oas-examples/main/3.1/yaml/petstore.yaml
You can filter the specification to only include certain paths. The example below selects all operations under /pet and writes them to filtered.yaml:
npx @ai-foundry/openapi-tools filter \
--input https://raw.githubusercontent.com/readmeio/oas-examples/main/3.1/yaml/petstore.yaml \
--output ./filtered.yaml \
--select-paths "/pet"To generate Zod schemas for the same path prefix:
npx @ai-foundry/openapi-tools generate-zod \
--input https://raw.githubusercontent.com/readmeio/oas-examples/main/3.1/yaml/petstore.yaml \
--output ./models.ts \
--select-paths "/pet"To create Python TypedDict definitions:
npx @ai-foundry/openapi-tools generate-python-dict \
--input https://raw.githubusercontent.com/readmeio/oas-examples/main/3.1/yaml/petstore.yaml \
--output ./models.py \
--select-paths "/pet"