input โ
Type: string | Required
Path or http(s) URL of your OpenAPI/Swagger specification.
Usage โ
typescript
// openapi.config.ts
import { GeneratorConfig } from 'ng-openapi';
const config: GeneratorConfig = {
input: './swagger.json',
... // other configurations
};
export default config;Remote specifications work the same way:
typescript
const config: GeneratorConfig = {
input: 'https://api.example.com/openapi.yaml',
... // other configurations
};Supported Formats โ
- JSON:
.jsonfiles containing OpenAPI/Swagger specifications - YAML:
.yaml/.ymlfiles containing OpenAPI/Swagger specifications - URLs:
http(s)URLs returning any of the above
Notes โ
- The specification must be a valid Swagger 2.x or OpenAPI 3.x document
- Remote URLs must be accessible and return valid JSON/YAML content
- A
$refinto a property of a schema (#/components/schemas/X/properties/y) is inlined; deep pointers into other parts of the document are passed through with a warning โ see Schema References - Consider
validateInputto guard against unexpected spec changes when generating from a URL