Documentation
¶
Index ¶
- func GetValidatorForOpenAPI3Schema(oaiSchema *Schema, components *ComponentsForValidation) (*jsval.JSVal, error)
- type Components
- type ComponentsForValidation
- type ExpansionResources
- type Fixtures
- type HTTPVerb
- type MediaType
- type Operation
- type Parameter
- type Path
- type RequestBody
- type ResourceID
- type Response
- type Schema
- type Spec
- type StatusCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValidatorForOpenAPI3Schema ¶
func GetValidatorForOpenAPI3Schema(oaiSchema *Schema, components *ComponentsForValidation) (*jsval.JSVal, error)
Types ¶
type Components ¶
type ComponentsForValidation ¶
type ComponentsForValidation struct {
// contains filtered or unexported fields
}
func GetComponentsForValidation ¶
func GetComponentsForValidation(components *Components) *ComponentsForValidation
type ExpansionResources ¶
type ExpansionResources struct {
OneOf []*Schema `json:"oneOf" yaml:"oneOf"`
}
type Fixtures ¶
type Fixtures struct {
Resources map[ResourceID]interface{} `json:"resources" yaml:"resources"`
}
type Operation ¶
type Operation struct {
Description string `json:"description" yaml:"description"`
OperationID string `json:"operation_id" yaml:"operation_id"`
Parameters []*Parameter `json:"parameters" yaml:"parameters"`
RequestBody *RequestBody `json:"requestBody" yaml:"requestBody"`
Responses map[StatusCode]Response `json:"responses" yaml:"responses"`
}
type RequestBody ¶
type ResourceID ¶
type ResourceID string
type Schema ¶
type Schema struct {
AdditionalProperties bool `json:"additionalProperties,omitempty" yaml:"additionalProperties"`
AnyOf []*Schema `json:"anyOf,omitempty" yaml:"anyOf"`
Enum []interface{} `json:"enum,omitempty" yaml:"enum"`
Items *Schema `json:"items,omitempty" yaml:"items"`
Nullable bool `json:"nullable,omitempty" yaml:"nullable"`
Pattern string `json:"pattern,omitempty" yaml:"pattern"`
Properties map[string]*Schema `json:"properties,omitempty" yaml:"properties"`
Required []string `json:"required,omitempty" yaml:"required"`
Type string `json:"type,omitempty" yaml:"type"`
// Ref is populated if this JSON Schema is actually a JSON reference, and
// it defines the location of the actual schema definition.
Ref string `json:"$ref,omitempty" yaml:"$ref"`
XExpandableFields *[]string `json:"x-expandableFields,omitempty" yaml:"x-expandableFields"`
XExpansionResources *ExpansionResources `json:"x-expansionResources,omitempty" yaml:"x-expansionResources"`
XResourceID string `json:"x-resourceId,omitempty" yaml:"x-resourceId"`
}
func (*Schema) UnmarshalJSON ¶
type Spec ¶
type Spec struct {
Components Components `json:"components" yaml:"components"`
Paths map[Path]map[HTTPVerb]*Operation `json:"paths" yaml:"paths"`
}
type StatusCode ¶
type StatusCode string
Click to show internal directories.
Click to hide internal directories.