jsoac

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(s string) string

Types

type AdditionalProperties

type AdditionalProperties struct {
	// contains filtered or unexported fields
}

func (AdditionalProperties) MarshalJSON

func (a AdditionalProperties) MarshalJSON() ([]byte, error)

type AdditionalPropertiesAnyJsonItem

type AdditionalPropertiesAnyJsonItem struct {
	Type                 *string            `json:"type,omitempty"`
	Items                *SimpleByteArray   `json:"items,omitempty"`
	Format               *string            `json:"format,omitempty"`
	Ref                  *string            `json:"$ref,omitempty"`
	Properties           *SimpleByteArray   `json:"properties,omitempty"`
	AdditionalProperties *bool              `json:"additionalProperties,omitempty"`
	Enum                 *[]SimpleByteArray `json:"enum,omitempty"`
	Example              *SimpleByteArray   `json:"example,omitempty"`
}

type AllOf

type AllOf struct {
	// contains filtered or unexported fields
}

func (AllOf) MarshalJSON

func (a AllOf) MarshalJSON() ([]byte, error)

type Any

type Any struct {
	Example     *Example     `json:"example,omitempty"`
	Nullable    *Nullable    `json:"nullable,omitempty"`
	Description *Description `json:"description,omitempty"`
}

func (*Any) SetNodeDescription

func (n *Any) SetNodeDescription(s string)

type Array

type Array struct {
	OADType     OADType      `json:"type"`
	Items       ArrayItems   `json:"items"`
	MinItems    *int64       `json:"minItems,omitempty"`
	MaxItems    *int64       `json:"maxItems,omitempty"`
	Nullable    *Nullable    `json:"nullable,omitempty"`
	Description *Description `json:"description,omitempty"`
}

func (*Array) SetNodeDescription

func (a *Array) SetNodeDescription(s string)

type ArrayItem

type ArrayItem struct {
	// contains filtered or unexported fields
}

type ArrayItems

type ArrayItems struct {
	// contains filtered or unexported fields
}

func (ArrayItems) MarshalJSON

func (ai ArrayItems) MarshalJSON() ([]byte, error)

type Description

type Description struct {
	// contains filtered or unexported fields
}

func (Description) MarshalJSON

func (ex Description) MarshalJSON() (b []byte, err error)

type Enum

type Enum struct {
	// contains filtered or unexported fields
}

func (Enum) MarshalJSON

func (e Enum) MarshalJSON() ([]byte, error)

type Example

type Example struct {
	// contains filtered or unexported fields
}

func (Example) MarshalJSON

func (ex Example) MarshalJSON() (b []byte, err error)

type JSOAC

type JSOAC struct {
	// contains filtered or unexported fields
}

func New

func New(j *jschema.JSchema) *JSOAC

func NewFromASTNode

func NewFromASTNode(astNode schema.ASTNode) *JSOAC

func (JSOAC) MarshalJSON

func (o JSOAC) MarshalJSON() (b []byte, err error)

func (*JSOAC) SetDescription

func (o *JSOAC) SetDescription(s string)

type Node

type Node interface {
	SetNodeDescription(string)
}

type Null

type Null struct {
	Example     *Example     `json:"example,omitempty"`
	Enum        *Enum        `json:"enum,omitempty"`
	Nullable    *Nullable    `json:"nullable,omitempty"`
	Description *Description `json:"description,omitempty"`
}

func (*Null) SetNodeDescription

func (n *Null) SetNodeDescription(s string)

type Nullable

type Nullable struct {
	// contains filtered or unexported fields
}

func (Nullable) MarshalJSON

func (n Nullable) MarshalJSON() (b []byte, err error)

type Number

type Number struct {
	// contains filtered or unexported fields
}

func (Number) MarshalJSON

func (n Number) MarshalJSON() (b []byte, err error)

type OADType

type OADType int // OpenAPI Data Types
const (
	OADTypeString  OADType = iota // string
	OADTypeInteger                // integer
	OADTypeNumber                 // number
	OADTypeBoolean                // boolean
	OADTypeArray                  // array
	OADTypeObject                 // object
)

func (OADType) MarshalJSON

func (t OADType) MarshalJSON() (b []byte, err error)

func (OADType) String

func (i OADType) String() string

type Object

type Object struct {
	OADType              OADType               `json:"type"`
	Properties           ObjectProperties      `json:"properties"`
	Required             []string              `json:"required,omitempty"`
	AllOf                *AllOf                `json:"allOf,omitempty"`
	AdditionalProperties *AdditionalProperties `json:"additionalProperties,omitempty"`
	Nullable             *Nullable             `json:"nullable,omitempty"`
	Description          *Description          `json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*Object) SetNodeDescription

func (o *Object) SetNodeDescription(s string)

type ObjectProperties

type ObjectProperties struct {
	// contains filtered or unexported fields
}

func (ObjectProperties) MarshalJSON

func (op ObjectProperties) MarshalJSON() ([]byte, error)

type Or

type Or struct {
	AnyOf       []Node       `json:"anyOf,omitempty"`
	Example     *Example     `json:"example,omitempty"`
	Nullable    *Nullable    `json:"nullable,omitempty"`
	Description *Description `json:"description,omitempty"`
}

func (*Or) SetNodeDescription

func (o *Or) SetNodeDescription(s string)

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

func (Pattern) MarshalJSON

func (ex Pattern) MarshalJSON() (b []byte, err error)

type Primitive

type Primitive struct {
	OADType          *OADType     `json:"type,omitempty"`
	Example          *Example     `json:"example,omitempty"`
	Pattern          *Pattern     `json:"pattern,omitempty"`
	Format           *string      `json:"format,omitempty"`
	Enum             *Enum        `json:"enum,omitempty"`
	Minimum          *Number      `json:"minimum,omitempty"`
	Maximum          *Number      `json:"maximum,omitempty"`
	ExclusiveMinimum *bool        `json:"exclusiveMinimum,omitempty"`
	ExclusiveMaximum *bool        `json:"exclusiveMaximum,omitempty"`
	MinLength        *int64       `json:"minLength,omitempty"`
	MaxLength        *int64       `json:"maxLength,omitempty"`
	MultipleOf       *float64     `json:"multipleOf,omitempty"`
	Nullable         *Nullable    `json:"nullable,omitempty"`
	Description      *Description `json:"description,omitempty"`
}

func (*Primitive) SetNodeDescription

func (p *Primitive) SetNodeDescription(s string)

type Property

type Property struct {
	// contains filtered or unexported fields
}

type Ref

type Ref struct {
	UserType    UserTypeArray `json:"allOf"`
	Example     *Example      `json:"example,omitempty"`
	Nullable    *Nullable     `json:"nullable,omitempty"`
	Description *Description  `json:"description,omitempty"`
}

func (Ref) MarshalJSON

func (r Ref) MarshalJSON() ([]byte, error)

func (*Ref) SetNodeDescription

func (r *Ref) SetNodeDescription(s string)

type SimpleByteArray

type SimpleByteArray []byte

func (SimpleByteArray) MarshalJSON

func (s SimpleByteArray) MarshalJSON() ([]byte, error)

type UserType

type UserType struct {
	// contains filtered or unexported fields
}

func (UserType) MarshalJSON

func (u UserType) MarshalJSON() ([]byte, error)

type UserTypeArray

type UserTypeArray struct {
	UserType
}

func (UserTypeArray) MarshalJSON

func (u UserTypeArray) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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