-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Is your feature request related to a problem? Please describe.
Echo supports param tag, but swag does not seem to support it. The swagger doc is generated based on the Go field name instead. The doc only gets generated properly if I use uri tag as well.
https://echo.labstack.com/docs/binding#data-sources
Would swag be interested if I open a PR adding that support?
Example of the code I have now, which depends on uri to work:
type PutRequestBody struct {
CustomerID uuid.UUID `json:"customerId" validate:"required,uuid"`
}
type PutRequestParams struct {
ProjectID string `uri:"projectId" param:"projectId" validate:"required"`
}
type PutRequest struct {
PutRequestBody
PutRequestParams
}
// Put
//
// @Summary Assign entity
// @Accept json
// @Produce json
// @Param path path PutRequestParams true "Path Parameters"
// @Param body body PutRequestBody true "Request Body"
// @Success 200 {object} nil
// @Failure 400 {object} GeneralError "Bad Request"
// @Failure 401 {object} GeneralError "Unauthorized"
// @Failure 403 {object} GeneralError "Forbidden"
// @Failure 404 {object} GeneralError "Not Found"
// @Failure 500 {object} GeneralError "Internal Server Error"
// @Router /api/v2/projects/{projectId} [put]
// @Security BearerDescribe the solution you'd like
Add support for echo param tag, so there is no need to use uri tag anymore.
Describe alternatives you've considered
Using uri is a temporary workaround.
Metadata
Metadata
Assignees
Labels
No labels