parser

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parser contains the parser for OpenAPI Spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand added in v0.65.0

func Expand(api *openapi.API) (*ogen.Spec, error)

Expand generates an expanded ogen.Spec from given api.

func Parse

func Parse(spec *ogen.Spec, s Settings) (_ *openapi.API, rerr error)

Parse parses raw Spec into

Types

type FeatureVersionError added in v0.53.0

type FeatureVersionError struct {
	Feature string
	Minimum openapi.Version
	Actual  openapi.Version
}

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

type LocationError = location.Error

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
}

Settings is parser settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL