Files
libopenapi/datamodel/low/model_interfaces.go
Dave Shanley 61f99b8fd6 Replacing extensions hash code **breaking change**
This is a large update, I realized that extensions are not being hashed correctly, and because I have the same code everywhere, it means running back through the stack and cleaning up the invalid code that will break if multiple extensions are used in different positions in the raw spec.

At the same time, I realized that the v2 model has the same primitive/enum issues that are part cleaned up in v3. This is a breaking changhe because enums are now []any and not []string, as well as primitives for bool, int etc are all pointers now instead of the copied values.

This will break any consumers.
2022-11-18 11:00:34 -05:00

112 lines
3.6 KiB
Go

// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
// SPDX-License-Identifier: MIT
package low
type SharedParameters interface {
Hash() [32]byte
GetName() *NodeReference[string]
GetIn() *NodeReference[string]
GetDescription() *NodeReference[string]
GetAllowEmptyValue() *NodeReference[bool]
GetRequired() *NodeReference[bool]
GetSchema() *NodeReference[any] // requires cast.
}
type HasDescription interface {
GetDescription() *NodeReference[string]
}
type SwaggerParameter interface {
SharedParameters
GetType() *NodeReference[string]
GetFormat() *NodeReference[string]
GetCollectionFormat() *NodeReference[string]
GetDefault() *NodeReference[any]
GetMaximum() *NodeReference[int]
GetExclusiveMaximum() *NodeReference[bool]
GetMinimum() *NodeReference[int]
GetExclusiveMinimum() *NodeReference[bool]
GetMaxLength() *NodeReference[int]
GetMinLength() *NodeReference[int]
GetPattern() *NodeReference[string]
GetMaxItems() *NodeReference[int]
GetMinItems() *NodeReference[int]
GetUniqueItems() *NodeReference[bool]
GetEnum() *NodeReference[[]ValueReference[any]]
GetMultipleOf() *NodeReference[int]
}
type SwaggerHeader interface {
Hash() [32]byte
GetType() *NodeReference[string]
GetDescription() *NodeReference[string]
GetFormat() *NodeReference[string]
GetCollectionFormat() *NodeReference[string]
GetDefault() *NodeReference[any]
GetMaximum() *NodeReference[int]
GetExclusiveMaximum() *NodeReference[bool]
GetMinimum() *NodeReference[int]
GetExclusiveMinimum() *NodeReference[bool]
GetMaxLength() *NodeReference[int]
GetMinLength() *NodeReference[int]
GetPattern() *NodeReference[string]
GetMaxItems() *NodeReference[int]
GetMinItems() *NodeReference[int]
GetUniqueItems() *NodeReference[bool]
GetEnum() *NodeReference[[]ValueReference[any]]
GetMultipleOf() *NodeReference[int]
GetItems() *NodeReference[any] // requires cast.
}
type OpenAPIHeader interface {
Hash() [32]byte
GetDescription() *NodeReference[string]
GetDeprecated() *NodeReference[bool]
GetStyle() *NodeReference[string]
GetAllowReserved() *NodeReference[bool]
GetExplode() *NodeReference[bool]
GetExample() *NodeReference[any]
GetRequired() *NodeReference[bool]
GetAllowEmptyValue() *NodeReference[bool]
GetSchema() *NodeReference[any] // requires cast.
GetExamples() *NodeReference[any] // requires cast.
GetContent() *NodeReference[any] // requires cast.
}
type OpenAPIParameter interface {
SharedParameters
GetDeprecated() *NodeReference[bool]
GetStyle() *NodeReference[string]
GetAllowReserved() *NodeReference[bool]
GetExplode() *NodeReference[bool]
GetExample() *NodeReference[any]
GetExamples() *NodeReference[any] // requires cast.
GetContent() *NodeReference[any] // requires cast.
}
type SharedOperations interface {
GetTags() NodeReference[[]ValueReference[string]]
GetSummary() NodeReference[string]
GetDescription() NodeReference[string]
GetDeprecated() NodeReference[bool]
GetExtensions() map[KeyReference[string]]ValueReference[any]
GetExternalDocs() NodeReference[any] // requires cast.
GetResponses() NodeReference[any] // requires cast.
GetParameters() NodeReference[any] // requires cast.
GetSecurity() NodeReference[any] // requires cast.
}
type SwaggerOperations interface {
SharedOperations
GetConsumes() NodeReference[[]ValueReference[string]]
GetProduces() NodeReference[[]ValueReference[string]]
GetSchemes() NodeReference[[]ValueReference[string]]
}
type OpenAPIOperations interface {
SharedOperations
//GetCallbacks() NodeReference[map[KeyReference[string]]ValueReference[any]] // requires cast
GetServers() NodeReference[any] // requires cast.
}