annot8

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coupon

type Coupon struct {
	ID    int          `json:"id"`
	Type  DiscountType `json:"type"`
	Scope CouponScope  `json:"scope"`
}

Coupon is a simplified sqlc-generated struct used by tests.

type CouponScope

type CouponScope string

CouponScope represents scope values for coupons.

const (
	CouponScopeGlobal  CouponScope = "global"
	CouponScopePrivate CouponScope = "private"
)

type DiscountType

type DiscountType string

DiscountType represents discount type values generated by sqlc.

const (
	DiscountTypePercentage DiscountType = "percentage"
	DiscountTypeFixed      DiscountType = "fixed"
)

type MyEnum

type MyEnum string

MyEnum is a test enum representing string-based constants.

const (
	MyEnumA MyEnum = "A"
	MyEnumB MyEnum = "B"
)

type TagExample

type TagExample struct {
	ID    string `json:"id"              annot8:"format=uuid,deprecated=true,default=00000000-0000-0000-0000-000000000000"`
	Alias string `json:"alias,omitempty" annot8:"pattern=^a.*$,minLength=2,maxLength=5"`
	Email string `json:"email"                                                                                              validate:"email"`
	Owner string `` /* 137-byte string literal not displayed */
}

TagExample exercises enhanced tag handling when generating schemas.

type TestAliasMap

type TestAliasMap map[string]int

TestAliasMap is a type alias for a map.

type TestAliasSlice

type TestAliasSlice []TestSimple

TestAliasSlice is a type alias for a slice.

type TestCompliance31

type TestCompliance31 struct {
	Count int     `json:"count" annot8:"exclusiveMin=0,exclusiveMax=100"`
	Rate  float64 `json:"rate"  annot8:"exclusiveMin=0.5"`
}

TestCompliance31 verifies OpenAPI 3.1 specific schema features.

type TestNested

type TestNested struct {
	Simple TestSimple `json:"simple"`
}

TestNested verifies nested struct references across generated schemas.

type TestSimple

type TestSimple struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

TestSimple is a helper struct used by annot8 tests to verify schema generation.

type TestWithArray

type TestWithArray struct {
	Tags []string `json:"tags"`
}

TestWithArray exercises array field handling in schema generation.

type TestWithEnumField

type TestWithEnumField struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Status MyEnum `json:"status"`
}

TestWithEnumField verifies that enum fields in structs are properly referenced

type TestWithPointer

type TestWithPointer struct {
	Name *string `json:"name,omitempty"`
}

TestWithPointer exercises pointer field handling in schema generation.

type TestWithQualified

type TestWithQualified struct {
	Other testHelperOther `json:"other"`
}

TestWithQualified ensures qualified type names are generated for nested structs.

Jump to

Keyboard shortcuts

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