Déplacer déclarations de route à pave pour API spec autogénérée #176

Merged
vlbeaudoin merged 17 commits from feature/pave into main 2023-11-20 17:05:41 -05:00
4 changed files with 5 additions and 5 deletions
Showing only changes of commit d3dc5b1571 - Show all commits

View file

@ -37,8 +37,8 @@ func (h *V1Handler) V1BucketsGET(c echo.Context) error {
return c.JSON(response.StatusCode, response)
}
func (h *V1Handler) HandleV1BucketRead(c echo.Context) error {
var response apiresponse.V1BucketRead
func (h *V1Handler) V1BucketGET(c echo.Context) error {
var response apiresponse.V1BucketGET
bucket := c.Param("bucket")

View file

@ -7,7 +7,7 @@ type V1BucketsGET struct {
}
}
type V1BucketRead struct {
type V1BucketGET struct {
Response
Data struct {
Keys []string

View file

@ -232,7 +232,7 @@ func RunServer() {
groupV1.GET("/bucket", v1Handler.V1BucketsGET)
groupV1.GET("/bucket/:bucket", v1Handler.HandleV1BucketRead)
groupV1.GET("/bucket/:bucket", v1Handler.V1BucketGET)
groupV1.POST("/bucket/:bucket", v1Handler.HandleV1DocumentCreate)

View file

@ -66,7 +66,7 @@ func (h *WebHandler) HandleDocumentation(c echo.Context) error {
for bucket, displayName := range v1BucketsGET.Data.Buckets {
// TODO move call to dedicated API client method
var v1BucketReadResponse apiresponse.V1BucketRead
var v1BucketReadResponse apiresponse.V1BucketGET
if err = h.ApiClient.Voki.Unmarshal(http.MethodGet, fmt.Sprintf("/v1/bucket/%s", bucket), nil, true, &v1BucketReadResponse); err != nil {
response.Error = err.Error()