We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm defining my struct inside the function itself:
// CreateClient godoc // @Summary Create a new client // @Tags Client, Create // @Produce json // @Consumes json // @Param client body NewClientRequest true "Client object" // @Success 200 {string} string "OK" // @Router /clients [post] func (h *ClientHandler) handleCreateClient(c echo.Context) error { type NewClientRequest struct { FirstName string `json:"first_name" validate:"required,alpha,min=2,max=50"` MiddleName string `json:"middle_name" validate:"omitempty,alpha,min=0,max=50"` LastName string `json:"last_name" validate:"required,alpha,min=2,max=50"` Phone string `json:"phone" validate:"omitempty,e164"` DateOfBirth string `json:"date_of_birth" validate:"required,yyyy-mm-dd"` }
When parsing I get the following error unless I move the struct above the annotations.
:cannot find type definition: NewClientRequest
Is there a way to make this work? Can we add comments inside the function itself?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm defining my struct inside the function itself:
When parsing I get the following error unless I move the struct above the annotations.
:cannot find type definition: NewClientRequest
Is there a way to make this work? Can we add comments inside the function itself?
The text was updated successfully, but these errors were encountered: