Skip to content

Commit

Permalink
Merge pull request #45 from kpetremann/main
Browse files Browse the repository at this point in the history
fix(swagger): model swapped between afk_enabled endpoints
  • Loading branch information
kpetremann authored Jan 7, 2025
2 parents 2e98d87 + ba11720 commit b20ff74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/api/router/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func (m *Manager) ListenAndServe(ctx context.Context, address string, port int,
mux.HandleFunc("GET /v1/devices/{hostname}/config", withAuth.Wrap(m.getDeviceConfig))

api.Get("/v1/devices/*/afk_enabled").
HasResponseModel(http.StatusOK, rest.ModelOf[device.AFKEnabledResponse]()).
HasResponseModel(http.StatusOK, rest.ModelOf[map[string]device.AFKEnabledResponse]()).
HasTags([]string{"devices"}).HasDescription("Give all devices that should run AFK")
api.Get("/v1/devices/{hostname}/afk_enabled").
HasResponseModel(http.StatusOK, rest.ModelOf[map[string]device.AFKEnabledResponse]()).
HasResponseModel(http.StatusOK, rest.ModelOf[device.AFKEnabledResponse]()).
HasPathParameter("hostname", rest.PathParam{Description: "Device hostname", Type: rest.PrimitiveTypeString}).
HasTags([]string{"devices"}).HasDescription("Tells if a device should run AFK")

Expand Down

0 comments on commit b20ff74

Please sign in to comment.