Skip to main content

OpenAPI

Input support; openapi

  • OpenAPI 3.0.x
  • OpenAPI 3.1.x
  • OpenAPI 2.0.0 (Swagger)
PresetsOpenAPI
payloads
parameters
headers
types
channels
client
custom
models

Basic Usage

Configuration

Create a configuration file that specifies OpenAPI as the input type:

{
"inputType": "openapi",
"inputPath": "./api/openapi.yaml",
"language": "typescript",
"generators": [ ... ]
}

Remote URL inputs

inputPath accepts an http:// or https:// URL. Optional authentication (bearer token, API key, or custom headers) is configured via the auth field. Cross-spec $ref URLs are also resolved through the same auth-aware HTTP client. See the configurations guide for examples and the auth scope and security considerations section — the configured headers are sent to every $ref target as well as the root URL.

Troubleshooting

FAQ

Can I use both OpenAPI and AsyncAPI in the same project?

Yes! You can have separate configuration files for each input type and generate code to different output directories.

Can I customize the generated code?

Yes, use the custom generator preset to create your own generation logic.