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"` MultipleOf []string `json:"multipleOf"` Maximum float64 `json:"maximum"` ExclusiveMaximum float64 `json:"exclusiveMaximum"` Minimum float64 `json:"minimum"` ExclusiveMinimum float64 `json:"exclusiveMinimum"` MaxLength uint `json:"maxLength"` MinLength uint `json:"minLength"` Pattern string `json:"pattern"` MaxItems uint `json:"maxItems"` MinItems uint `json:"minItems"` UniqueItems bool `json:"uniqueItems"` MaxProperties uint `json:"maxProperties"` MinProperties uint `json:"minProperties"` Enum []any `json:"enum"` Const any `json:"const"` AllOf []*T `json:"allOf"` AnyOf []*T `json:"anyOf"` OneOf []*T `json:"oneOf"` // --- 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.