Documentation
¶
Overview ¶
Package parser contains the parser for OpenAPI Spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FeatureVersionError ¶ added in v0.53.0
FeatureVersionError is an error that is returned when a feature is used that requires a newer version of OpenAPI.
func (*FeatureVersionError) Error ¶ added in v0.53.0
func (f *FeatureVersionError) Error() string
Error implements error.
type LocationError ¶ added in v0.42.0
LocationError is a wrapper for an error that has a location.
type Settings ¶ added in v0.36.0
type Settings struct {
// External is external JSON Schema resolver. If nil, NoExternal resolver is used.
External jsonschema.ExternalResolver
// File is the file that is being parsed.
//
// Used for error messages.
File location.File
// RootURL is the root URL of the spec.
//
// If nil, jsonpointer.DummyURL is used.
RootURL *url.URL
// DepthLimit limits the number of nested references. Default is 1000.
DepthLimit int
// Enables type inference.
//
// For example:
//
// {
// "items": {
// "type": "string"
// }
// }
//
// In that case schemaParser will handle that schema as "array" schema, because it has "items" field.
InferTypes bool
// AllowCrossTypeConstraints enables interpretation of cross-type schema constraints.
// When true (default), constraints like pattern on numbers or maximum on strings
// are allowed and interpreted during code generation.
AllowCrossTypeConstraints bool
// AuthenticationSchemes is the list of allowed HTTP Authorization schemes in a Security Scheme Object.
//
// Authorization schemes are case-insensitive.
//
// If empty, the ones registered in https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml are used.
//
// See https://swagger.io/specification/#security-scheme-object.
AuthenticationSchemes []string
// DisallowDuplicateMethodPaths controls whether paths that normalize to the same
// structure (e.g., /pets/{petId} and /pets/{id}) are allowed when they have
// different HTTP methods.
//
// When false (default), paths with different parameter names but different HTTP methods
// are allowed, and operations are disambiguated by path + params + method.
//
// When true, duplicate paths are always rejected per strict OpenAPI spec interpretation.
DisallowDuplicateMethodPaths bool
}
Settings is parser settings.
Source Files
¶
- errors.go
- expand.go
- parse_components.go
- parse_example.go
- parse_header.go
- parse_info.go
- parse_mediatype.go
- parse_parameter.go
- parse_path_item.go
- parse_request_body.go
- parse_response.go
- parse_schema.go
- parse_security.go
- parse_server.go
- parse_webhook.go
- parser.go
- path_parser.go
- resolve.go
- resolver.go
- settings.go
- version.go
Click to show internal directories.
Click to hide internal directories.