Skip to content

Commit 9d7951f

Browse files
committed
fix: correct swagger description for Insights API
1 parent b723da9 commit 9d7951f

File tree

4 files changed

+177
-46
lines changed

4 files changed

+177
-46
lines changed

coderd/apidoc/docs.go

+68-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+65-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/insights.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const insightsTimeLayout = time.RFC3339
3030
// @Security CoderSessionToken
3131
// @Produce json
3232
// @Tags Insights
33+
// @Param tz_offset query int true "Time-zone offset (e.g. -2)"
3334
// @Success 200 {object} codersdk.DAUsResponse
3435
// @Router /insights/daus [get]
3536
func (api *API) deploymentDAUs(rw http.ResponseWriter, r *http.Request) {
@@ -100,8 +101,9 @@ func (api *API) returnDAUsInternal(rw http.ResponseWriter, r *http.Request, temp
100101
// @Security CoderSessionToken
101102
// @Produce json
102103
// @Tags Insights
103-
// @Param before query int true "Start time"
104-
// @Param after query int true "End time"
104+
// @Param start_time query string true "Start time" format(date-time)
105+
// @Param end_time query string true "End time" format(date-time)
106+
// @Param template_ids query []string false "Template IDs" collectionFormat(csv)
105107
// @Success 200 {object} codersdk.UserActivityInsightsResponse
106108
// @Router /insights/user-activity [get]
107109
func (api *API) insightsUserActivity(rw http.ResponseWriter, r *http.Request) {
@@ -202,8 +204,9 @@ func (api *API) insightsUserActivity(rw http.ResponseWriter, r *http.Request) {
202204
// @Security CoderSessionToken
203205
// @Produce json
204206
// @Tags Insights
205-
// @Param before query int true "Start time"
206-
// @Param after query int true "End time"
207+
// @Param start_time query string true "Start time" format(date-time)
208+
// @Param end_time query string true "End time" format(date-time)
209+
// @Param template_ids query []string false "Template IDs" collectionFormat(csv)
207210
// @Success 200 {object} codersdk.UserLatencyInsightsResponse
208211
// @Router /insights/user-latency [get]
209212
func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) {
@@ -294,8 +297,10 @@ func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) {
294297
// @Security CoderSessionToken
295298
// @Produce json
296299
// @Tags Insights
297-
// @Param before query int true "Start time"
298-
// @Param after query int true "End time"
300+
// @Param start_time query string true "Start time" format(date-time)
301+
// @Param end_time query string true "End time" format(date-time)
302+
// @Param interval query string true "Interval" enums(week,day)
303+
// @Param template_ids query []string false "Template IDs" collectionFormat(csv)
299304
// @Success 200 {object} codersdk.TemplateInsightsResponse
300305
// @Router /insights/templates [get]
301306
func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)