Documentation
¶
Overview ¶
Package reflectschema enriches a Source's operations with request-body JSON Schemas reflected from Go structs. It exists for embedded mode: a router exposes method+path but not the request type behind each handler, so without help a POST tool would have an empty body schema. Register the request struct per operation and this fills the gap from the struct's json tags.
src := reflectschema.New(ginadapter.New(r)).
Body("post_users", CreateUserRequest{})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enricher ¶
type Enricher struct {
// contains filtered or unexported fields
}
Enricher wraps a base Source and augments operations whose request struct has been registered by operation id.
Click to show internal directories.
Click to hide internal directories.