Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sparktype) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sparktype
Generate static types from OpenAPI specifications.
Installation
npm install -g sparktype
# or
npx sparktype generateUsage
# Generate types using typegen.jsonc in current directory
sparktype generate
# Specify config file
sparktype generate --config ./path/to/typegen.jsonc
# Initialize a new config file
sparktype init
# Validate config file
sparktype validateConfiguration
Create a typegen.jsonc file:
{
"specs": {
"api": {
"path": "./openapi.yaml"
}
},
"outputs": [
{
"path": "./src/types/api.ts",
"format": "typescript",
"spec": "api"
}
]
}Supported Output Formats
typescript- TypeScript interfaceszod- Zod schemas with inferred typespython- Python TypedDict classesgo- Go structs with JSON tags
Documentation
For full documentation, visit: https://github.com/hntrl/sparktype