oas31

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 13 Imported by: 0 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 oas31 contains an implementation of the OAS v3.1 JSON Schema specification https://spec.openapis.org/oas/v3.1.0#schema-object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discriminator

type Discriminator struct {
	PropertyName string
	Mapping      *sequencedmap.Map[string, string]
	Extensions   *extensions.Extensions
}

type EitherValue

type EitherValue[L any, LCore any, R any, RCore any] struct {
	Left  *L
	Right *R
	// contains filtered or unexported fields
}

func (*EitherValue[L, LCore, R, RCore]) GetCore

func (e *EitherValue[L, LCore, R, RCore]) GetCore() *core.EitherValue[LCore, RCore]

func (*EitherValue[L, LCore, R, RCore]) GetLeft

func (e *EitherValue[L, LCore, R, RCore]) GetLeft() L

func (*EitherValue[L, LCore, R, RCore]) GetRight

func (e *EitherValue[L, LCore, R, RCore]) GetRight() R

func (*EitherValue[L, LCore, R, RCore]) IsLeft

func (e *EitherValue[L, LCore, R, RCore]) IsLeft() bool

func (*EitherValue[L, LCore, R, RCore]) IsRight

func (e *EitherValue[L, LCore, R, RCore]) IsRight() bool

type ExclusiveMaximum

type ExclusiveMaximum = *EitherValue[bool, bool, float64, float64]

func NewExclusiveMaximumFromBool

func NewExclusiveMaximumFromBool(value bool) ExclusiveMaximum

func NewExclusiveMaximumFromFloat64

func NewExclusiveMaximumFromFloat64(value float64) ExclusiveMaximum

type ExclusiveMinimum

type ExclusiveMinimum = *EitherValue[bool, bool, float64, float64]

func NewExclusiveMinimumFromBool

func NewExclusiveMinimumFromBool(value bool) ExclusiveMinimum

func NewExclusiveMinimumFromFloat64

func NewExclusiveMinimumFromFloat64(value float64) ExclusiveMinimum

type ExternalDoc

type ExternalDoc struct {
	Description *string
	URL         string
	Extensions  *extensions.Extensions
}

type JSONSchema

type JSONSchema = *EitherValue[Schema, core.Schema, bool, bool]

func NewJSONSchemaFromBool

func NewJSONSchemaFromBool(value bool) JSONSchema

func NewJSONSchemaFromSchema

func NewJSONSchemaFromSchema(value *Schema) JSONSchema

func NewJSONSchemaOrBoolFromBool

func NewJSONSchemaOrBoolFromBool(value bool) JSONSchema

func NewJSONSchemaOrBoolFromJSONSchema

func NewJSONSchemaOrBoolFromJSONSchema(value Schema) JSONSchema

type Reference

type Reference[T any] struct{}

type Schema

type Schema struct {
	Ref                   *string
	ExclusiveMaximum      ExclusiveMaximum
	ExclusiveMinimum      ExclusiveMinimum
	Type                  Type
	AllOf                 []JSONSchema
	OneOf                 []JSONSchema
	AnyOf                 []JSONSchema
	Discriminator         *Discriminator
	Examples              []Value
	PrefixItems           []JSONSchema
	Contains              JSONSchema
	MinContains           *int64
	MaxContains           *int64
	If                    JSONSchema
	Else                  JSONSchema
	Then                  JSONSchema
	DependentSchemas      *sequencedmap.Map[string, JSONSchema]
	PatternProperties     *sequencedmap.Map[string, JSONSchema]
	PropertyNames         JSONSchema
	UnevaluatedItems      JSONSchema
	UnevaluatedProperties JSONSchema
	Items                 JSONSchema
	Anchor                *string
	Not                   JSONSchema
	Properties            *sequencedmap.Map[string, JSONSchema]
	Title                 *string
	MultipleOf            *float64
	Maximum               *float64
	Minimum               *float64
	MaxLength             *int64
	MinLength             *int64
	Pattern               *string
	Format                *string
	MaxItems              *int64
	MinItems              *int64
	UniqueItems           *bool
	MaxProperties         *int64
	MinProperties         *int64
	Required              []string
	Enum                  []Value
	AdditionalProperties  JSONSchema
	Description           *string
	Default               Value
	Const                 Value
	Nullable              *bool
	ReadOnly              *bool
	WriteOnly             *bool
	ExternalDocs          *ExternalDoc
	Example               Value
	Deprecated            *bool
	Schema                *string
	Extensions            *extensions.Extensions

	Valid bool
	// contains filtered or unexported fields
}

func (*Schema) GetCore

func (js *Schema) GetCore() *core.Schema

func (*Schema) Validate

func (js *Schema) Validate(ctx context.Context, opts ...validation.Option) []error

type Type

type Type = *EitherValue[[]string, []string, string, string]

func NewTypeFromArray

func NewTypeFromArray(value []string) Type

func NewTypeFromString

func NewTypeFromString(value string) Type

type Value

type Value = *yaml.Node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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