Documentation
¶
Overview ¶
Package testserver provides a comprehensive Huma-based HTTP server that serves an auto-generated OpenAPI spec and implements operations for E2E contract testing.
Index ¶
- func StartTestServer(t *testing.T) (baseURL, specURL string, cleanup func())
- type AllOfOutput
- type AllOfPart1
- type AllOfPart2
- type AnyOfOutput
- type CircleShape
- type ConfigOutput
- type CreateUserInput
- type CreateWidgetInput
- type CreateWidgetOutput
- type DefaultsOutput
- type DeleteWidgetInput
- type EchoInput
- type EchoOutput
- type GetUserInput
- type GetWidgetInput
- type GetWidgetOutput
- type LegacyOutput
- type LoginInput
- type LoginOutput
- type MetadataOutput
- type NullableOutput
- type OneOfOutput
- type RectangleShape
- type SearchInput
- type SearchOutput
- type ShapeOutput
- type TagsOutput
- type TreeNode
- type TreeOutput
- type UserOutput
- type Widget
- type WidgetListOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartTestServer ¶
StartTestServer starts an HTTP server with a comprehensive Huma API for E2E tests. Returns baseURL, specURL (baseURL + /openapi.json), and a cleanup function.
Types ¶
type AllOfOutput ¶
type AllOfOutput struct {
Body struct {
AllOfPart1
AllOfPart2
} `json:"body"`
}
type AllOfPart1 ¶
type AllOfPart1 struct {
A string `json:"a"`
}
type AllOfPart2 ¶
type AllOfPart2 struct {
B int `json:"b"`
}
type AnyOfOutput ¶
type AnyOfOutput struct {
Body struct {
Value string `json:"value"`
} `json:"body"`
}
type CircleShape ¶
type ConfigOutput ¶
type CreateUserInput ¶
type CreateWidgetInput ¶
type CreateWidgetOutput ¶
type DefaultsOutput ¶
type DeleteWidgetInput ¶
type DeleteWidgetInput struct {
WidgetID string `path:"widgetId"`
}
type EchoInput ¶
type EchoInput struct {
RequestID string `header:"X-Request-ID" doc:"Request ID"`
}
type EchoOutput ¶
type EchoOutput struct {
Body struct {
RequestID string `json:"requestId"`
} `json:"body"`
}
type GetUserInput ¶
type GetUserInput struct {
UserID string `path:"userId"`
}
type GetWidgetInput ¶
type GetWidgetInput struct {
WidgetID string `path:"widgetId" doc:"Widget ID"`
}
type GetWidgetOutput ¶
type LegacyOutput ¶
type LegacyOutput struct {
Body struct {
Message string `json:"message"`
} `json:"body"`
}
type LoginInput ¶
type LoginOutput ¶
type LoginOutput struct {
Body struct {
Token string `json:"token"`
} `json:"body"`
}
type MetadataOutput ¶
type NullableOutput ¶
type OneOfOutput ¶
type RectangleShape ¶
type SearchInput ¶
type SearchOutput ¶
type ShapeOutput ¶
type ShapeOutput struct {
Body json.RawMessage `json:"body"`
}
type TagsOutput ¶
type TagsOutput struct {
Body []string `json:"body" minItems:"1" maxItems:"10"`
}
type TreeOutput ¶
type TreeOutput struct {
Body TreeNode `json:"body"`
}
type UserOutput ¶
type WidgetListOutput ¶
type WidgetListOutput struct {
Body []Widget `json:"body"`
}
Click to show internal directories.
Click to hide internal directories.