Documentation ¶
Index ¶
- func IsChangedBasic(a, b *Schema) bool
- type Schema
- func (s *Schema) FindRefById(id string) (refs []*Schema)
- func (s *Schema) IsRefId(id string) bool
- func (s *Schema) Ref() bool
- func (s *Schema) RemovePropertyByRefId(id string, stype string)
- func (s *Schema) RemoveXOrderByName(name string)
- func (s *Schema) SetXDiff(x *string)
- func (s *Schema) Valid() error
- func (s *Schema) Validation(raw []byte) error
- type SliceOrOneValue
- type ValueOrBoolean
- func (v *ValueOrBoolean[T]) Bool() bool
- func (v *ValueOrBoolean[T]) IsBool() bool
- func (v ValueOrBoolean[T]) MarshalJSON() ([]byte, error)
- func (v *ValueOrBoolean[T]) SetBoolean(b bool)
- func (v *ValueOrBoolean[T]) SetValue(value T)
- func (v *ValueOrBoolean[T]) UnmarshalJSON(raw []byte) error
- func (v *ValueOrBoolean[T]) Value() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsChangedBasic ¶
Types ¶
type Schema ¶
type Schema struct { // 3.1 []string 2,3.0 string, if this schema is reference, it will be null Type *SliceOrOneValue[string] `json:"type,omitempty"` XOrder []string `json:"x-apicat-orders,omitempty"` XMock string `json:"x-apicat-mock,omitempty"` // diff 如果有值就代表有变化 XDiff *string `json:"x-apicat-diff,omitempty"` // category path XCategory string `json:"x-apicat-category,omitempty"` // 3.1 schema or bool Items *ValueOrBoolean[*Schema] `json:"items,omitempty"` // 3.0 bool 3.1 int ExclusiveMaximum *ValueOrBoolean[int64] `json:"exclusiveMaximum,omitempty"` ExclusiveMinimum *ValueOrBoolean[int64] `json:"exclusiveMinimum,omitempty"` // 所有版本 Not *Schema `json:"not,omitempty"` Properties map[string]*Schema `json:"properties,omitempty"` Title string `json:"title,omitempty"` MultipleOf *int64 `json:"multipleOf,omitempty"` Maximum *int64 `json:"maximum,omitempty"` Minimum *int64 `json:"minimum,omitempty"` MaxLength *int64 `json:"maxLength,omitempty"` MinLength *int64 `json:"minLength,omitempty"` Format string `json:"format,omitempty"` Pattern string `json:"pattern,omitempty"` MaxItems *int64 `json:"maxItems,omitempty"` MinItems *int64 `json:"minItems,omitempty"` UniqueItems *int64 `json:"uniqueItems,omitempty"` MaxProperties *int64 `json:"maxProperties,omitempty"` MinProperties *int64 `json:"minProperties,omitempty"` Required []string `json:"required,omitempty"` Enum []any `json:"enum,omitempty"` AdditionalProperties *ValueOrBoolean[*Schema] `json:"additionalProperties,omitempty"` Description string `json:"description,omitempty"` Default any `json:"default,omitempty"` Nullable *bool `json:"nullable,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` WriteOnly bool `json:"writeOnly,omitempty"` Example any `json:"example,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Reference *string `json:"$ref,omitempty"` }
func (*Schema) FindRefById ¶
func (*Schema) RemovePropertyByRefId ¶
func (*Schema) RemoveXOrderByName ¶
func (*Schema) Validation ¶
type SliceOrOneValue ¶
type SliceOrOneValue[T any] struct { // contains filtered or unexported fields }
func CreateSliceOrOne ¶
func CreateSliceOrOne[T any](v ...T) *SliceOrOneValue[T]
func (SliceOrOneValue[T]) MarshalJSON ¶
func (s SliceOrOneValue[T]) MarshalJSON() ([]byte, error)
func (*SliceOrOneValue[T]) SetValue ¶
func (s *SliceOrOneValue[T]) SetValue(v ...T)
func (*SliceOrOneValue[T]) UnmarshalJSON ¶
func (s *SliceOrOneValue[T]) UnmarshalJSON(raw []byte) error
func (*SliceOrOneValue[T]) Value ¶
func (s *SliceOrOneValue[T]) Value() []T
type ValueOrBoolean ¶
type ValueOrBoolean[T any] struct { // contains filtered or unexported fields }
func (*ValueOrBoolean[T]) Bool ¶
func (v *ValueOrBoolean[T]) Bool() bool
func (*ValueOrBoolean[T]) IsBool ¶
func (v *ValueOrBoolean[T]) IsBool() bool
func (ValueOrBoolean[T]) MarshalJSON ¶
func (v ValueOrBoolean[T]) MarshalJSON() ([]byte, error)
func (*ValueOrBoolean[T]) SetBoolean ¶
func (v *ValueOrBoolean[T]) SetBoolean(b bool)
func (*ValueOrBoolean[T]) SetValue ¶
func (v *ValueOrBoolean[T]) SetValue(value T)
func (*ValueOrBoolean[T]) UnmarshalJSON ¶
func (v *ValueOrBoolean[T]) UnmarshalJSON(raw []byte) error
func (*ValueOrBoolean[T]) Value ¶
func (v *ValueOrBoolean[T]) Value() T
Click to show internal directories.
Click to hide internal directories.