Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomResponse ¶
type CustomResponse struct { Model any // contains filtered or unexported fields }
CustomResponse represents a custom implementation of Response.
func New ¶
func New(model any, returnCode string, description string) CustomResponse
New creates a new instance of Response with the provided model return code, and description.
func (CustomResponse) Description ¶
func (c CustomResponse) Description() string
func (CustomResponse) ReturnCode ¶
func (c CustomResponse) ReturnCode() string
type ResponseGenerator ¶
type ResponseGenerator struct{}
ResponseGenerator is a struct that provides functionality to generate response schemas.
func NewResponseGenerator ¶
func NewResponseGenerator() *ResponseGenerator
NewResponseGenerator creates a new instance of ResponseGenerator.
func (ResponseGenerator) Generate ¶
func (g ResponseGenerator) Generate(model any) *parameter.JsonResponseSchema
Generate generates a JSON response schema based on the provided model. It uses reflection to determine the type of the model and constructs the appropriate JSON schema. This function handles different types such as slices, maps, and structures to create a detailed and accurate schema.
Click to show internal directories.
Click to hide internal directories.