Skip to content

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: .json files containing OpenAPI/Swagger specifications
  • YAML: .yaml / .yml files 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 $ref into 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 validateInput to guard against unexpected spec changes when generating from a URL

Released under the MIT License.
This site is powered by Netlify
About ยท Impressum