swagger_parser_core library
Typed Swagger 2.0, OpenAPI 3.0, 3.1, and 3.2 documents.
Use OpenApiParser to parse JSON or YAML from a SchemaSource.
Classes
- Diagnostic
- A diagnostic message with a code and optional source position.
- DocumentLoader
- Loads external sources by retrieval URI.
- DocumentNode
- One object at a physical JSON Pointer in an OpenAPI document.
- EffectivePathItem
- Effective fields of a Path Item after following its references.
- JsonValue
- An explicitly present JSON value. JsonValue(null) differs from an absent optional JsonValue field. Containers are copied and recursively immutable.
- LocatedNode
- An OpenAPI node with its physical document and schema context.
- NormalizeConfig
- Controls changes to a parsed OpenAPI document.
- OpenApiDocument
- A parsed document that preserves its declared specification version.
- OpenApiNormalizer
- Normalizes a parsed document in its declared OpenAPI version.
- OpenApiParser
- Parses Swagger 2.0, OpenAPI 3.0, 3.1, and 3.2 documents.
- OpenApiReferenceResolver
- Builds a reference graph without changing the document.
- OpenApiV30AdditionalProperties
- A boolean or schema for extra object properties.
- OpenApiV30AdditionalPropertiesAllowed
- A boolean rule for extra object properties.
- OpenApiV30AdditionalPropertiesSchema
- A schema that constrains extra object properties.
- OpenApiV30ApiKeySecurityScheme
- An API key passed in a named request field.
- OpenApiV30Callback
- Callback path items indexed by runtime expression.
- OpenApiV30Components
- Named definitions for use elsewhere in the document.
- OpenApiV30Contact
- Contact details for questions about the API.
- OpenApiV30Discriminator
- A property that selects a schema for a payload.
- OpenApiV30Document
- Root of the OpenAPI 3.0 document tree.
- OpenApiV30Encoding
- Serialization rules for one request body property.
- OpenApiV30Example
- An inline example or a link to an external example.
- OpenApiV30ExternalDocumentation
- A link to additional documentation.
- OpenApiV30Header
- The value and serialization rules for an HTTP header.
- OpenApiV30HttpSecurityScheme
- An HTTP authentication scheme for the Authorization header.
- OpenApiV30Info
- Title, version, and publication details of the described API.
-
OpenApiV30Inline<
T extends OpenApiV30JsonSerializable> - A definition stored at its point of use.
- OpenApiV30JsonSerializable
- A document object that can export its fields as JSON.
- OpenApiV30License
- License terms for the API.
- OpenApiV30Link
- Inputs for another operation derived from this response.
- OpenApiV30MediaType
- Schema, examples, and encoding for one media type.
- OpenApiV30OAuth2SecurityScheme
- OAuth 2.0 authorization settings.
- OpenApiV30OAuthFlow
- Authorization endpoints and scopes for an OAuth flow.
- OpenApiV30OAuthFlows
- OAuth grant types supported by the authorization server.
- OpenApiV30OpenIdConnectSecurityScheme
- OpenID Connect discovery settings.
- OpenApiV30Operation
- The request and possible responses for one HTTP method.
- OpenApiV30Parameter
- A named input to an operation.
- OpenApiV30PathItem
- Operations and shared parameters for one path.
- OpenApiV30Paths
- Path items indexed by relative API path.
-
OpenApiV30Reference<
T extends OpenApiV30JsonSerializable> - A reference to a local or external definition.
-
OpenApiV30RefOr<
T extends OpenApiV30JsonSerializable> - An inline definition or a reference to another definition.
- OpenApiV30RequestBody
- Request payloads indexed by media type.
- OpenApiV30Response
- A documented response and its payload metadata.
- OpenApiV30Responses
-
Responses indexed by status code or
default. - OpenApiV30Schema
- The structure, constraints, and annotations of a payload.
- OpenApiV30SecurityRequirement
- Security schemes that must be satisfied together.
- OpenApiV30SecurityScheme
- Credentials an operation can require.
- OpenApiV30Server
- A base URL with optional template variables.
- OpenApiV30ServerVariable
- A substitution for a variable in a server URL.
- OpenApiV30Tag
- Metadata for a group of operations.
- OpenApiV30Xml
- XML element, attribute, and namespace rules for a property.
- OpenApiV31ApiKeySecurityScheme
- An API key passed in a named request field.
- OpenApiV31BooleanSchema
- A schema that accepts every instance or none.
- OpenApiV31Callback
- Callback path items indexed by runtime expression.
- OpenApiV31Components
- Named definitions for use elsewhere in the document.
- OpenApiV31Contact
- Contact details for questions about the API.
- OpenApiV31Discriminator
- A property that selects a schema for a payload.
- OpenApiV31Document
- Root of the OpenAPI 3.1 document tree.
- OpenApiV31Encoding
- Serialization rules for one request body property.
- OpenApiV31Example
- An inline example or a link to an external example.
- OpenApiV31ExternalDocumentation
- A link to additional documentation.
- OpenApiV31ForeignSchema
- Preserves keywords of a dialect the parser cannot interpret.
- OpenApiV31Header
- The value and serialization rules for an HTTP header.
- OpenApiV31HttpSecurityScheme
- An HTTP authentication scheme for the Authorization header.
- OpenApiV31Info
- Title, version, and publication details of the described API.
-
OpenApiV31Inline<
T extends OpenApiV31JsonSerializable> - A definition stored at its point of use.
- OpenApiV31JsonSerializable
- A document object that can export its fields as JSON.
- OpenApiV31License
- License terms for the API.
- OpenApiV31Link
- Inputs for another operation derived from this response.
- OpenApiV31MediaType
- Schema, examples, and encoding for one media type.
- OpenApiV31MutualTlsSecurityScheme
- Client authentication with a TLS certificate.
- OpenApiV31OAuth2SecurityScheme
- OAuth 2.0 authorization settings.
- OpenApiV31OAuthFlow
- Authorization endpoints and scopes for an OAuth flow.
- OpenApiV31OAuthFlows
- OAuth grant types supported by the authorization server.
- OpenApiV31ObjectSchema
- JSON Schema keywords and annotations for a 3.1 schema object.
- OpenApiV31OpenIdConnectSecurityScheme
- OpenID Connect discovery settings.
- OpenApiV31Operation
- The request and possible responses for one HTTP method.
- OpenApiV31Parameter
- A named input to an operation.
- OpenApiV31PathItem
- Operations and shared parameters for one path.
- OpenApiV31Paths
- Path items indexed by relative API path.
-
OpenApiV31Reference<
T extends OpenApiV31JsonSerializable> - A reference to a local or external definition.
-
OpenApiV31RefOr<
T extends OpenApiV31JsonSerializable> - An inline definition or a reference to another definition.
- OpenApiV31RequestBody
- Request payloads indexed by media type.
- OpenApiV31Response
- A documented response and its payload metadata.
- OpenApiV31Responses
-
Responses indexed by status code or
default. - OpenApiV31Schema
- A boolean or object schema with its effective dialect.
- OpenApiV31SchemaType
-
The single name or list used for the schema's
type. - OpenApiV31SecurityRequirement
- Security schemes that must be satisfied together.
- OpenApiV31SecurityScheme
- Credentials an operation can require.
- OpenApiV31Server
- A base URL with optional template variables.
- OpenApiV31ServerVariable
- A substitution for a variable in a server URL.
- OpenApiV31SingleType
- A schema type written as one name.
- OpenApiV31Tag
- Metadata for a group of operations.
- OpenApiV31TypeSet
- Schema types written as an array of names.
- OpenApiV31Xml
- XML element, attribute, and namespace rules for a property.
- OpenApiV32ApiKeySecurityScheme
- An API key passed in a named request field.
- OpenApiV32BooleanSchema
- A schema that accepts every instance or none.
- OpenApiV32Callback
- Callback path items indexed by runtime expression.
- OpenApiV32Components
- Named definitions for use elsewhere in the document.
- OpenApiV32Contact
- Contact details for questions about the API.
- OpenApiV32Discriminator
- A property that selects a schema for a payload.
- OpenApiV32Document
- Root of the OpenAPI 3.2 document tree.
- OpenApiV32Encoding
- Serialization rules for one request body property.
- OpenApiV32Example
- An inline example or a link to an external example.
- OpenApiV32ExternalDocumentation
- A link to additional documentation.
- OpenApiV32ForeignSchema
- Preserves keywords of a dialect the parser cannot interpret.
- OpenApiV32Header
- The value and serialization rules for an HTTP header.
- OpenApiV32HttpSecurityScheme
- An HTTP authentication scheme for the Authorization header.
- OpenApiV32Info
- Title, version, and publication details of the described API.
-
OpenApiV32Inline<
T extends OpenApiV32JsonSerializable> - A definition stored at its point of use.
- OpenApiV32JsonSerializable
- A document object that can export its fields as JSON.
- OpenApiV32License
- License terms for the API.
- OpenApiV32Link
- Inputs for another operation derived from this response.
- OpenApiV32MediaType
- Schema, examples, and encoding for one media type.
- OpenApiV32MutualTlsSecurityScheme
- Client authentication with a TLS certificate.
- OpenApiV32OAuth2SecurityScheme
- OAuth 2.0 authorization settings.
- OpenApiV32OAuthFlow
- Authorization endpoints and scopes for an OAuth flow.
- OpenApiV32OAuthFlows
- OAuth grant types supported by the authorization server.
- OpenApiV32ObjectSchema
- JSON Schema keywords and annotations for a 3.2 schema object.
- OpenApiV32OpenIdConnectSecurityScheme
- OpenID Connect discovery settings.
- OpenApiV32Operation
- The request and possible responses for one HTTP method.
- OpenApiV32Parameter
- A named input to an operation.
- OpenApiV32PathItem
- Operations and shared parameters for one path.
- OpenApiV32Paths
- Path items indexed by relative API path.
-
OpenApiV32Reference<
T extends OpenApiV32JsonSerializable> - A reference to a local or external definition.
-
OpenApiV32RefOr<
T extends OpenApiV32JsonSerializable> - An inline definition or a reference to another definition.
- OpenApiV32RequestBody
- Request payloads indexed by media type.
- OpenApiV32Response
- A documented response and its payload metadata.
- OpenApiV32Responses
-
Responses indexed by status code or
default. - OpenApiV32Schema
- A boolean or object schema with its effective dialect.
- OpenApiV32SchemaType
-
The single name or list used for the schema's
type. - OpenApiV32SecurityRequirement
- Security schemes that must be satisfied together.
- OpenApiV32SecurityScheme
- Credentials an operation can require.
- OpenApiV32Server
- A base URL with optional template variables.
- OpenApiV32ServerVariable
- A substitution for a variable in a server URL.
- OpenApiV32SingleType
- A schema type written as one name.
- OpenApiV32Tag
- Metadata for a group of operations.
- OpenApiV32TypeSet
- Schema types written as an array of names.
- OpenApiV32Xml
- XML element, attribute, and namespace rules for a property.
- OpenApiValidator
- Checks a document and reports validation diagnostics.
- OpenApiVersion
- Feature family and the exact version declared in the source document.
- ParameterSerialization
- Effective wire settings for a request parameter.
- ParseConfig
- Controls source positions, unknown fields, and nesting depth.
- ReferenceGraph
- References indexed by the physical location of each URI field.
- ReferenceTarget
- An object or boolean schema at a resolved location.
- ResolvedOperationValidator
- Checks operations reachable from paths, webhooks, and callbacks.
- ResolvedReference
- One reference from a source field to its initial target.
- SchemaSource
- In-memory JSON or YAML input for the parser.
- SourceLocation
- One-based line/column and zero-based UTF-16 offset in the source text.
- SwaggerV2AdditionalProperties
- A boolean or schema for extra object properties.
- SwaggerV2AdditionalPropertiesAllowed
- A boolean rule for extra object properties.
- SwaggerV2AdditionalPropertiesSchema
- A schema that constrains extra object properties.
- SwaggerV2ApiKeySecurityScheme
- An API key passed in a named request field.
- SwaggerV2BasicSecurityScheme
- HTTP Basic authentication.
- SwaggerV2BodyParameter
- An operation parameter that describes the request body.
- SwaggerV2Contact
- Contact details for questions about the API.
- SwaggerV2Document
- Root of the Swagger 2.0 document tree.
- SwaggerV2ExternalDocumentation
- A link to additional documentation.
- SwaggerV2Header
- The value and serialization rules for an HTTP header.
- SwaggerV2Info
- Title, version, and publication details of the described API.
-
SwaggerV2Inline<
T extends SwaggerV2JsonSerializable> - A definition stored at its point of use.
- SwaggerV2Items
- The element type and constraints of an array parameter or header.
- SwaggerV2JsonSerializable
- A document object that can export its fields as JSON.
- SwaggerV2License
- License terms for the API.
- SwaggerV2OAuth2SecurityScheme
- OAuth 2.0 authorization settings.
- SwaggerV2Operation
- The request and possible responses for one HTTP method.
- SwaggerV2Parameter
- A named input to an operation.
- SwaggerV2PathItem
- Operations and shared parameters for one path.
- SwaggerV2Paths
- Path items indexed by relative API path.
-
SwaggerV2Reference<
T extends SwaggerV2JsonSerializable> - A reference to a local or external definition.
-
SwaggerV2RefOr<
T extends SwaggerV2JsonSerializable> - An inline definition or a reference to another definition.
- SwaggerV2Response
- A documented response and its payload metadata.
- SwaggerV2Responses
-
Responses indexed by status code or
default. - SwaggerV2Schema
- The structure, constraints, and annotations of a payload.
- SwaggerV2SchemaItems
- One schema for all items or one schema per tuple position.
- SwaggerV2SchemaType
-
The single name or list used for the schema's
type. - SwaggerV2SecurityRequirement
- Security schemes that must be satisfied together.
- SwaggerV2SecurityScheme
- Credentials an operation can require.
- SwaggerV2SingleItems
- A schema that applies to every item in an array.
- SwaggerV2SingleType
- A schema type written as one name.
- SwaggerV2Tag
- Metadata for a group of operations.
- SwaggerV2TupleItems
- Schemas that apply to successive array positions.
- SwaggerV2TypeSet
- Schema types written as an array of names.
- SwaggerV2ValueParameter
- A primitive, array, or file parameter outside the request body.
- SwaggerV2Xml
- XML element, attribute, and namespace rules for a property.
- ValidationReport
- The diagnostics from one validation pass.
Enums
- DiagnosticSeverity
- The effect of a diagnostic on processing.
- NodeKind
- Object roles that contain references or operations.
- OpenApiFamily
- The specification family that defines a document's structure.
- OpenApiV30ApiKeyLocation
- The part of the request that carries an API key.
- OpenApiV30SecuritySchemeType
- The authentication mechanism of a security scheme.
- OpenApiV30Type
- A type name accepted by OpenAPI 3.0.
- OpenApiV31ApiKeyLocation
- The part of the request that carries an API key.
- OpenApiV31SecuritySchemeType
- The authentication mechanism of a security scheme.
- OpenApiV31Type
- A type name accepted by OpenAPI 3.1.
- OpenApiV32ApiKeyLocation
- The part of the request that carries an API key.
- OpenApiV32ParameterLocation
- The part of the request that carries a parameter.
- OpenApiV32SecuritySchemeType
- The authentication mechanism of a security scheme.
- OpenApiV32Style
- How a parameter is serialized in a request.
- OpenApiV32Type
- A type name accepted by OpenAPI 3.2.
- OpenApiV32XmlNodeType
- XML representation of a schema value.
- SchemaDialect
- Schema keyword sets supported by parsing and reference resolution.
- SchemaFormat
- The decoding mode for source text.
- SwaggerV2ApiKeyLocation
- The part of the request that carries an API key.
- SwaggerV2CollectionFormat
- The wire format of an array parameter.
- SwaggerV2OAuthFlow
- The OAuth grant declared by a Swagger 2.0 security scheme.
- SwaggerV2ParameterLocation
- The part of the request that carries a parameter.
- SwaggerV2Type
- A type name accepted by Swagger 2.0.
- UnknownFieldPolicy
- How the parser handles unknown fields on fixed-field objects.
Mixins
- OpenApiV30Object
- Common fields for specification extensions and unrecognized properties.
- OpenApiV31Object
- Common fields for specification extensions and unrecognized properties.
- OpenApiV32Object
- Common fields for specification extensions and unrecognized properties.
- SwaggerV2Object
- Preserves extensions and unknown fields without interpreting them.
Extensions
- SwaggerV2TypeName on SwaggerV2Type
- The spelling of a Swagger type in the source document.
Typedefs
- OpenApiV30ParameterLocation = OpenApiParameterLocation
- The part of the request that carries a parameter.
- OpenApiV30Style = OpenApiParameterStyle
- The serialization style of a parameter.
- OpenApiV31ParameterLocation = OpenApiParameterLocation
- The part of the request that carries a parameter.
- OpenApiV31Style = OpenApiParameterStyle
- The serialization style of a parameter.
- ReferenceLocation = ({Uri? documentUri, String pointer})
- Physical document URI and JSON Pointer. In-memory input can omit the URI.
Exceptions / Errors
- OpenApiException
- An input failure with optional source coordinates.
- ReferenceResolutionException
- A reference, resource identifier, or external document could not be resolved.
- SchemaParseException
- A syntax or structural error in the input document.
- UnsupportedOpenApiVersionException
- The declared specification version has no parser.