Make produce/consumes more compact

This commit is contained in:
Jannis Mattheis 2018-11-24 10:22:39 +01:00
parent c841e1cd24
commit dfb71dabbc
6 changed files with 33 additions and 66 deletions

View File

@ -36,10 +36,8 @@ type ApplicationAPI struct {
// Create an application.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -80,10 +78,8 @@ func (a *ApplicationAPI) CreateApplication(ctx *gin.Context) {
// Return all applications.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -118,10 +114,8 @@ func (a *ApplicationAPI) GetApplications(ctx *gin.Context) {
// Delete an application.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// parameters:
// - name: id
// in: path
@ -162,10 +156,8 @@ func (a *ApplicationAPI) DeleteApplication(ctx *gin.Context) {
// Update info for an application
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -225,8 +217,7 @@ func (a *ApplicationAPI) UpdateApplication(ctx *gin.Context) {
// ---
// consumes:
// - multipart/form-data
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []

View File

@ -30,10 +30,8 @@ type ClientAPI struct {
// Create a client.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -74,10 +72,8 @@ func (a *ClientAPI) CreateClient(ctx *gin.Context) {
// Return all clients.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -109,10 +105,8 @@ func (a *ClientAPI) GetClients(ctx *gin.Context) {
// Delete a client.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// parameters:
// - name: id
// in: path

View File

@ -51,8 +51,7 @@ type pagingParams struct {
// Return all messages.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -128,8 +127,7 @@ func withPaging(ctx *gin.Context, f func(pagingParams *pagingParams)) {
// Return all messages from a specific application.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -187,8 +185,7 @@ func (a *MessageAPI) GetMessagesWithApplication(ctx *gin.Context) {
// Delete all messages.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -215,8 +212,7 @@ func (a *MessageAPI) DeleteMessages(ctx *gin.Context) {
// Delete all messages from a specific application.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -254,8 +250,7 @@ func (a *MessageAPI) DeleteMessageWithApplication(ctx *gin.Context) {
// Deletes a message with an id.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []

View File

@ -123,8 +123,7 @@ func (a *API) register(client *client) {
//
// ---
// schema: ws, wss
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []

View File

@ -32,8 +32,7 @@ type UserAPI struct {
// Return all users.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -70,8 +69,7 @@ func (a *UserAPI) GetUsers(ctx *gin.Context) {
// Return the current user.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -100,10 +98,8 @@ func (a *UserAPI) GetCurrentUser(ctx *gin.Context) {
// Create a user.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -147,10 +143,8 @@ func (a *UserAPI) CreateUser(ctx *gin.Context) {
// Get a user.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -190,8 +184,7 @@ func (a *UserAPI) GetUserByID(ctx *gin.Context) {
// Deletes a user.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -230,10 +223,8 @@ func (a *UserAPI) DeleteUserByID(ctx *gin.Context) {
// Update the password of the current user.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
@ -271,10 +262,8 @@ func (a *UserAPI) ChangePassword(ctx *gin.Context) {
// Update a user.
//
// ---
// consumes:
// - application/json
// produces:
// - application/json
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []

View File

@ -64,8 +64,7 @@ func Create(db *database.GormDatabase, vInfo *model.VersionInfo, conf *config.Co
// Get version information.
//
// ---
// produces:
// - application/json
// produces: [application/json]
// responses:
// 200:
// description: Ok