generators

package
v0.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJSONTags added in v0.43.0

func GenerateJSONTags[T any](schema asyncapi.Validations[T], field string) string

GenerateJSONTags returns the "json" tag for a given field in a struct, based on the asyncapi contract.

func GenerateValidateTags added in v0.40.0

func GenerateValidateTags[T any](schema asyncapi.Validations[T], isPointer bool, schemaType string) string

GenerateValidateTags returns the "validate" tag for a given field in a struct, based on the asyncapi contract. This tag can then be used by go-playground/validator/v10 to validate the struct's content.

Types

type Side added in v0.3.1

type Side string

Side represents the side of the code generation based on asyncapi documentation, i.e in front (user) or behind (application) asyncapi specification.

const (
	// SideIsApplication is the application side based on asyncapi documentation,
	// i.e. the side that stand behind of the asyncapi specification.
	SideIsApplication Side = "app"
	// SideIsUser is the user side based on asyncapi documentation,
	// i.e. the side that use the asyncapi specification.
	SideIsUser Side = "user"
)

Directories

Path Synopsis
v2
v3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL