Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
interface SwaggerToTSOptions
import { type SwaggerToTSOptions } from "https://deno.land/x/revolt_api@0.4.0/scripts/types.ts";

Properties

optional
additionalProperties: boolean

Allow arbitrary properties on schemas (default: false)

optional
auth: string

(optional) Specify auth if using openapi-typescript to fetch URL

optional
cwd: URL

(optional) Specify current working directory (cwd) to resolve remote schemas on disk (not needed for remote URL schemas)

optional
formatter: SchemaFormatter

Specify a formatter

optional
immutableTypes: boolean

Generates immutable types (readonly properties and readonly array)

optional
defaultNonNullable: boolean

(optional) Treat schema objects with default values as non-nullable

optional
prettierConfig: string

(optional) Path to Prettier config

optional
rawSchema: boolean

(optional) Parsing input document as raw schema rather than OpenAPI document

optional
silent: boolean

(optional) Should logging be suppressed? (necessary for STDOUT)

optional
version: number

(optional) OpenAPI version. Must be present if parsing raw schema

optional
httpHeaders: Headers

(optional) List of HTTP headers that will be sent with the fetch request to a remote schema. This is in addition to the authorization header. In some cases, servers require headers such as Accept: application/json or Accept: text/yaml to be sent in order to figure out how to properly fetch the OpenAPI/Swagger document as code. These headers will only be sent in the case that the schema URL protocol is of type http or https.

optional
httpMethod: string

HTTP verb used to fetch the schema from a remote server. This is only applied when the schema is a string and has the http or https protocol present. By default, the request will use the HTTP GET method to fetch the schema from the server.

optional
exportType: boolean

(optional) Export type instead of interface

optional
supportArrayLength: boolean

(optional) Generate tuples using array minItems / maxItems