parser

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package parser contains the parser for OpenAPI Spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

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

Parse parses raw Spec into

Types

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

	// Filename is a name of the file being parsed.
	//
	// Used for error messages.
	Filename string

	// 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