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 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 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 ¶
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.