Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedVersions = []string{
"2.0.0",
"2.1.0",
"2.2.0",
"2.3.0",
"2.4.0",
"2.5.0",
"2.6.0",
"3.0.0",
}
SupportedVersions describe the asyncapi-codegen supported versions.
Functions ¶
func IsMajorVersionSupported ¶ added in v0.39.0
IsMajorVersionSupported checks that the major version is supported.
func IsVersionSupported ¶ added in v0.32.0
IsVersionSupported checks that the version is supported.
Types ¶
type Specification ¶
type Specification interface {
// MajorVersion returns the major version of the AsyncAPI specification.
MajorVersion() int
// Process processes all information in specification in order to link the
// references, apply the traits and generating other information for code
// generation.
//
// WARNING: this will alter the specification as you will find, by example,
// traits applied in the specification.
Process() error
// AddDependency adds a dependency to the specification.
AddDependency(path string, spec Specification) error
}
Specification only contains common functions between each version. This should be casted to get all other functions, base on the version.
type Validations ¶ added in v0.40.0
type Validations[T any] struct { Required []string `json:"required,omitempty"` MultipleOf []string `json:"multipleOf,omitempty"` Maximum float64 `json:"maximum,omitempty"` ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` Minimum float64 `json:"minimum,omitempty"` ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` MaxLength uint `json:"maxLength,omitempty"` MinLength uint `json:"minLength,omitempty"` Pattern string `json:"pattern,omitempty"` MaxItems uint `json:"maxItems,omitempty"` MinItems uint `json:"minItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MaxProperties uint `json:"maxProperties,omitempty"` MinProperties uint `json:"minProperties,omitempty"` Enum []any `json:"enum,omitempty"` Const any `json:"const,omitempty"` AllOf []*T `json:"allOf,omitempty"` AnyOf []*T `json:"anyOf,omitempty"` OneOf []*T `json:"oneOf,omitempty"` // --- Non JSON Schema/AsyncAPI fields ------------------------------------- IsRequired bool `json:"-"` ShouldOmitEmpty *bool `json:"-"` }
Validations is a representation of the JSON-Object validation fields supported by asyncapi These fields are in common for v2 and v3.
func (*Validations[T]) Merge ¶ added in v0.45.2
func (v *Validations[T]) Merge(newV Validations[T])
Merge merges the newV into the current Validations.
Click to show internal directories.
Click to hide internal directories.