|
| 1 | +package data |
| 2 | + |
| 3 | +// Schema used to define structure of the data |
| 4 | +// This is a subset of OpenAPI 3.0 schema |
| 5 | +type Schema struct { |
| 6 | + Id string `json:"id,omitempty" yaml:"id,omitempty"` |
| 7 | + Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"` |
| 8 | + Schema string `json:"-" yaml:"-"` |
| 9 | + Description string `json:"description,omitempty" yaml:"description,omitempty"` |
| 10 | + Type string `json:"type,omitempty" yaml:"type,omitempty"` |
| 11 | + Nullable bool `json:"nullable,omitempty" yaml:"nullable,omitempty"` |
| 12 | + Format *string `json:"format,omitempty" yaml:"format,omitempty"` |
| 13 | + Title string `json:"title,omitempty" yaml:"title,omitempty"` |
| 14 | + Default any `json:"default,omitempty" yaml:"default,omitempty"` |
| 15 | + Maximum *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"` |
| 16 | + ExclusiveMaximum *float64 `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"` |
| 17 | + Minimum *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"` |
| 18 | + ExclusiveMinimum *float64 `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"` |
| 19 | + MaxLength *int `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` |
| 20 | + MinLength *int `json:"minLength,omitempty" yaml:"minLength,omitempty"` |
| 21 | + Pattern *string `json:"pattern,omitempty" yaml:"pattern,omitempty"` |
| 22 | + MaxItems *int `json:"maxItems,omitempty" yaml:"maxItems,omitempty"` |
| 23 | + MinItems *int `json:"minItems,omitempty" yaml:"minItems,omitempty"` |
| 24 | + UniqueItems bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"` |
| 25 | + MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"` |
| 26 | + Enum []any `json:"enum,omitempty" yaml:"enum,omitempty"` |
| 27 | + MaxProperties *int `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"` |
| 28 | + MinProperties *int `json:"minProperties,omitempty" yaml:"minProperties,omitempty"` |
| 29 | + Required []string `json:"required,omitempty" yaml:"required,omitempty"` |
| 30 | + Items *Schema `json:"items,omitempty" yaml:"items,omitempty"` |
| 31 | + AllOf []*Schema `json:"allOf,omitempty" yaml:"allOf,omitempty"` |
| 32 | + OneOf []*Schema `json:"oneOf,omitempty" yaml:"oneOf,omitempty"` |
| 33 | + AnyOf []*Schema `json:"anyOf,omitempty" yaml:"anyOf,omitempty"` |
| 34 | + Not *Schema `json:"not,omitempty" yaml:"not,omitempty"` |
| 35 | + Properties map[string]*Schema `json:"properties,omitempty" yaml:"properties,omitempty"` |
| 36 | + AdditionalItems *Schema `json:"additionalItems,omitempty" yaml:"additionalItems,omitempty"` |
| 37 | + Xml *Xml `json:"xml,omitempty" yaml:"xml,omitempty"` |
| 38 | + ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` |
| 39 | + WriteOnly bool `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"` |
| 40 | + Example any `json:"example,omitempty" yaml:"example,omitempty"` |
| 41 | + Examples []any `json:"examples,omitempty" yaml:"examples,omitempty"` |
| 42 | + Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +type Xml struct { |
| 46 | + Name *string `json:"name,omitempty" yaml:"name,omitempty"` |
| 47 | + Namespace *string `json:"namespace,omitempty" yaml:"namespace,omitempty"` |
| 48 | + Prefix *string `json:"prefix,omitempty" yaml:"prefix,omitempty"` |
| 49 | + Attribute *bool `json:"attribute,omitempty" yaml:"attribute,omitempty"` |
| 50 | + Wrapped *bool `json:"wrapped,omitempty" yaml:"wrapped,omitempty"` |
| 51 | +} |
0 commit comments