From 9ac57da91afc8bcec2e13bf50dead7e4653aa344 Mon Sep 17 00:00:00 2001 From: titouanfreville Date: Sun, 5 Mar 2017 21:37:54 +0100 Subject: [PATCH 1/3] Removed y strangers --- api/avatar_route.go | 2 +- api/user_route.go | 8 ++++---- swagger.yaml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/avatar_route.go b/api/avatar_route.go index fadf0cb..b60d0aa 100644 --- a/api/avatar_route.go +++ b/api/avatar_route.go @@ -86,7 +86,7 @@ func initAvatarRoute(router chi.Router) { r.Route("/:avatarName", func(r chi.Router) { r.Use(avatarContext) // swagger:route GET /avatar/name/{avatarName} Avatars getAvatarFromName - //y + // // Get avatar from name // // This will return the avatar object corresponding to provided name diff --git a/api/user_route.go b/api/user_route.go index 545ff92..a0b07b4 100644 --- a/api/user_route.go +++ b/api/user_route.go @@ -114,7 +114,7 @@ func initUserRoute(router chi.Router) { r.Route("/:userName", func(r chi.Router) { r.Use(userContext) // swagger:route GET /user/username/{userName} Users getUserFromName - //y + // // Get user from username // // This will return the user object corresponding to provided username @@ -130,7 +130,7 @@ func initUserRoute(router chi.Router) { r.Route("/:nickName", func(r chi.Router) { r.Use(userContext) // swagger:route GET /user/nickname/{nickName} Users getUserFromNickName - //y + // // Get user from nickname // // This will return the user object corresponding to provided nickname @@ -146,7 +146,7 @@ func initUserRoute(router chi.Router) { r.Route("/:firstName", func(r chi.Router) { r.Use(userContext) // swagger:route GET /user/firstname/{firstName} Users getUserFromFirstName - //y + // // Get user from firstname // // This will return the user object corresponding to provided firstname @@ -162,7 +162,7 @@ func initUserRoute(router chi.Router) { r.Route("/:lastName", func(r chi.Router) { r.Use(userContext) // swagger:route GET /user/lastname/{lastName} Users getUserFromLastName - //y + // // Get user from lastname // // This will return the user object corresponding to provided lastname diff --git a/swagger.yaml b/swagger.yaml index acb466e..b2a0c69 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -147,7 +147,7 @@ paths: get: tags: - "Avatars" - summary: "y\nGet avatar from name" + summary: "Get avatar from name" description: "This will return the avatar object corresponding to provided name" operationId: "getAvatarFromName" parameters: @@ -2056,7 +2056,7 @@ paths: get: tags: - "Users" - summary: "y\nGet user from firstname" + summary: "Get user from firstname" description: "This will return the user object corresponding to provided firstname" operationId: "getUserFromFirstName" parameters: @@ -2084,7 +2084,7 @@ paths: get: tags: - "Users" - summary: "y\nGet user from lastname" + summary: "Get user from lastname" description: "This will return the user object corresponding to provided lastname" operationId: "getUserFromLastName" parameters: @@ -2146,7 +2146,7 @@ paths: get: tags: - "Users" - summary: "y\nGet user from nickname" + summary: "Get user from nickname" description: "This will return the user object corresponding to provided nickname" operationId: "getUserFromNickName" parameters: @@ -2210,7 +2210,7 @@ paths: get: tags: - "Users" - summary: "y\nGet user from username" + summary: "Get user from username" description: "This will return the user object corresponding to provided username" operationId: "getUserFromName" parameters: From a2582256787220080f0d8117216e02674b881a34 Mon Sep 17 00:00:00 2001 From: titouanfreville Date: Sun, 5 Mar 2017 21:43:33 +0100 Subject: [PATCH 2/3] Linted --- datastores/data_store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/datastores/data_store.go b/datastores/data_store.go index 40f9570..06b3578 100644 --- a/datastores/data_store.go +++ b/datastores/data_store.go @@ -17,11 +17,12 @@ The following is a list of stores described: package datastores import ( + "log" + "github.com/titouanfreville/popcubeapi/models" u "github.com/titouanfreville/popcubeapi/utils" - // Importing sql driver. They are used by gorm package and used by default from blank. - "log" + // Importing sql driver. They are used by gorm package and used by default from blank. _ "github.com/go-sql-driver/mysql" "github.com/jinzhu/gorm" ) From ba6fc9337767b465f67a0bbcd647b55adb0277ad Mon Sep 17 00:00:00 2001 From: titouanfreville Date: Mon, 6 Mar 2017 13:27:37 +0100 Subject: [PATCH 3/3] Better errors --- api/api_doc.go | 4 ++-- api/avatar_route.go | 10 +++++----- api/channel_route.go | 10 +++++----- api/emojis_route.go | 10 +++++----- api/folder_route.go | 10 +++++----- api/member_route.go | 16 ++++++++-------- api/message_route.go | 14 +++++++------- api/organisation_route.go | 10 +++++----- api/parameter_route.go | 8 ++++---- api/role_route.go | 12 ++++++------ api/user_route.go | 12 ++++++------ scripts/slate_require.sh | 7 ++----- swagger.yaml | 40 +++++++++++++++++++-------------------- 13 files changed, 80 insertions(+), 83 deletions(-) diff --git a/api/api_doc.go b/api/api_doc.go index 789c9fb..dab4a95 100644 --- a/api/api_doc.go +++ b/api/api_doc.go @@ -3,8 +3,8 @@ * The inner API of Popcube aim to define every methods need to manage communication organisation inside PopCube chat project * * Schemes : http, https - * Host: api.popcube - * BasePath: /alpha + * Host: api-alpha.popcube.xyz + * BasePath: / * Version: alpha * Contact: Titouan Freville * diff --git a/api/avatar_route.go b/api/avatar_route.go index b60d0aa..492d022 100644 --- a/api/avatar_route.go +++ b/api/avatar_route.go @@ -38,7 +38,7 @@ func initAvatarRoute(router chi.Router) { // This will create an avatar for organisation avatars library. // // Responses: - // 200: avatarObjectSuccess + // 201: avatarObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -61,7 +61,7 @@ func initAvatarRoute(router chi.Router) { // This will create an avatar for organisation avatars library. // // Responses: - // 200: avatarObjectSuccess + // 201: avatarObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -192,13 +192,13 @@ func newAvatar(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Avatar == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Avatar().Save(data.Avatar, db) if err == nil { - render.JSON(w, 200, data.Avatar) + render.JSON(w, 201, data.Avatar) } else { render.JSON(w, err.StatusCode, err) } @@ -219,7 +219,7 @@ func updateAvatar(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) avatar := r.Context().Value(oldAvatarKey).(models.Avatar) - if err != nil { + if err != nil || data.Avatar == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/channel_route.go b/api/channel_route.go index 18cc44c..6df5026 100644 --- a/api/channel_route.go +++ b/api/channel_route.go @@ -38,7 +38,7 @@ func initChannelRoute(router chi.Router) { // This will create an channel for organisation channels library. // // Responses: - // 200: channelObjectSuccess + // 201: channelObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -61,7 +61,7 @@ func initChannelRoute(router chi.Router) { // This will create an channel for organisation channels library. // // Responses: - // 200: channelObjectSuccess + // 201: channelObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -229,13 +229,13 @@ func newChannel(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Channel == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Channel().Save(data.Channel, db) if err == nil { - render.JSON(w, 200, data.Channel) + render.JSON(w, 201, data.Channel) } else { render.JSON(w, err.StatusCode, err) } @@ -256,7 +256,7 @@ func updateChannel(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) channel := r.Context().Value(oldChannelKey).(models.Channel) - if err != nil { + if err != nil || data.Channel == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/emojis_route.go b/api/emojis_route.go index fc8027b..ac63518 100644 --- a/api/emojis_route.go +++ b/api/emojis_route.go @@ -39,7 +39,7 @@ func initEmojiRoute(router chi.Router) { // This will create an emoji for organisation emojis library. // // Responses: - // 200: emojiObjectSuccess + // 201: emojiObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -62,7 +62,7 @@ func initEmojiRoute(router chi.Router) { // This will create an emoji for organisation emojis library. // // Responses: - // 200: emojiObjectSuccess + // 201: emojiObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -211,13 +211,13 @@ func newEmoji(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Emoji == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Emoji().Save(data.Emoji, db) if err == nil { - render.JSON(w, 200, data.Emoji) + render.JSON(w, 201, data.Emoji) } else { render.JSON(w, err.StatusCode, err) } @@ -238,7 +238,7 @@ func updateEmoji(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) emoji := r.Context().Value(oldEmojiKey).(models.Emoji) - if err != nil { + if err != nil || data.Emoji == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/folder_route.go b/api/folder_route.go index e0ee96e..2c58034 100644 --- a/api/folder_route.go +++ b/api/folder_route.go @@ -39,7 +39,7 @@ func initFolderRoute(router chi.Router) { // This will create an folder for organisation folders library. // // Responses: - // 200: folderObjectSuccess + // 201: folderObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -62,7 +62,7 @@ func initFolderRoute(router chi.Router) { // This will create an folder for organisation folders library. // // Responses: - // 200: folderObjectSuccess + // 201: folderObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -245,13 +245,13 @@ func newFolder(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Folder == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Folder().Save(data.Folder, db) if err == nil { - render.JSON(w, 200, data.Folder) + render.JSON(w, 201, data.Folder) } else { render.JSON(w, err.StatusCode, err) } @@ -272,7 +272,7 @@ func updateFolder(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) folder := r.Context().Value(oldFolderKey).(models.Folder) - if err != nil { + if err != nil || data.Folder == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/member_route.go b/api/member_route.go index 1e142a2..75993ee 100644 --- a/api/member_route.go +++ b/api/member_route.go @@ -36,7 +36,7 @@ func initMemberRoute(router chi.Router) { // This will create an member for organisation members library. // // Responses: - // 200: memberObjectSuccess + // 201: memberObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -95,7 +95,7 @@ func initMemberRoute(router chi.Router) { // This will create an member for organisation members library. // // Responses: - // 200: memberObjectSuccess + // 201: memberObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -164,7 +164,7 @@ func getMemberFromUser(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.User == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -186,7 +186,7 @@ func getMemberFromChannel(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Channel == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -208,7 +208,7 @@ func getMemberFromRole(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Role == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -230,13 +230,13 @@ func newMember(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Member == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Member().Save(data.Member, db) if err == nil { - render.JSON(w, 200, data.Member) + render.JSON(w, 201, data.Member) } else { render.JSON(w, err.StatusCode, err) } @@ -257,7 +257,7 @@ func updateMember(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) member := r.Context().Value(oldMemberKey).(models.Member) - if err != nil { + if err != nil || data.Member == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/message_route.go b/api/message_route.go index a16547d..f4be1ba 100644 --- a/api/message_route.go +++ b/api/message_route.go @@ -37,7 +37,7 @@ func initMessageRoute(router chi.Router) { // This will create an message for organisation messages library. // // Responses: - // 200: messageObjectSuccess + // 201: messageObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -60,7 +60,7 @@ func initMessageRoute(router chi.Router) { // This will create an message for organisation messages library. // // Responses: - // 200: messageObjectSuccess + // 201: messageObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -180,7 +180,7 @@ func getMessageFromUser(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.User == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -202,7 +202,7 @@ func getMessageFromChannel(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Channel == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -224,13 +224,13 @@ func newMessage(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Message == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Message().Save(data.Message, db) if err == nil { - render.JSON(w, 200, data.Message) + render.JSON(w, 201, data.Message) } else { render.JSON(w, err.StatusCode, err) } @@ -251,7 +251,7 @@ func updateMessage(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) message := r.Context().Value(oldMessageKey).(models.Message) - if err != nil { + if err != nil || data.Message == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/organisation_route.go b/api/organisation_route.go index 5eac838..f2d2426 100644 --- a/api/organisation_route.go +++ b/api/organisation_route.go @@ -36,7 +36,7 @@ func initOrganisationRoute(router chi.Router) { // This will create an organisation for organisation organisations library. // // Responses: - // 200: organisationObjectSuccess + // 201: organisationObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -59,7 +59,7 @@ func initOrganisationRoute(router chi.Router) { // This will create an organisation for organisation organisations library. // // Responses: - // 200: organisationObjectSuccess + // 201: organisationObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -115,13 +115,13 @@ func newOrganisation(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Organisation == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Organisation().Save(data.Organisation, db) if err == nil { - render.JSON(w, 200, data.Organisation) + render.JSON(w, 201, data.Organisation) } else { render.JSON(w, err.StatusCode, err) } @@ -142,7 +142,7 @@ func updateOrganisation(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) organisation := r.Context().Value(oldOrganisationKey).(models.Organisation) - if err != nil { + if err != nil || data.Organisation == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/parameter_route.go b/api/parameter_route.go index 0e39e6a..8b98fd9 100644 --- a/api/parameter_route.go +++ b/api/parameter_route.go @@ -36,7 +36,7 @@ func initParameterRoute(router chi.Router) { // This will create an parameter for organisation parameters library. // // Responses: - // 200: parameterObjectSuccess + // 201: parameterObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -59,7 +59,7 @@ func initParameterRoute(router chi.Router) { // This will create an parameter for organisation parameters library. // // Responses: - // 200: parameterObjectSuccess + // 201: parameterObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -116,7 +116,7 @@ func newParameter(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Parameter == nil { render.JSON(w, 500, err) } else { if err := db.DB().Ping(); err == nil { @@ -143,7 +143,7 @@ func updateParameter(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) parameter := r.Context().Value(oldParameterKey).(models.Parameter) - if err != nil { + if err != nil || data.Parameter == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/role_route.go b/api/role_route.go index 5703dec..24fe918 100644 --- a/api/role_route.go +++ b/api/role_route.go @@ -37,7 +37,7 @@ func initRoleRoute(router chi.Router) { // This will get all the roles available in the organisation. // // Responses: - // 200: roleArraySuccess + // 201: roleArraySuccess // 503: databaseError // default: genericError r.Post("/", newRole) @@ -59,7 +59,7 @@ func initRoleRoute(router chi.Router) { // This will create an role for organisation roles library. // // Responses: - // 200: roleObjectSuccess + // 201: roleObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -166,7 +166,7 @@ func getRoleFromRight(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Role == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -188,13 +188,13 @@ func newRole(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Role == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.Role().Save(data.Role, db) if err == nil { - render.JSON(w, 200, data.Role) + render.JSON(w, 201, data.Role) } else { render.JSON(w, err.StatusCode, err) } @@ -215,7 +215,7 @@ func updateRole(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) role := r.Context().Value(oldRoleKey).(models.Role) - if err != nil { + if err != nil || data.Role == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/api/user_route.go b/api/user_route.go index a0b07b4..16a80be 100644 --- a/api/user_route.go +++ b/api/user_route.go @@ -42,7 +42,7 @@ func initUserRoute(router chi.Router) { // This will create an user for organisation users library. // // Responses: - // 200: userObjectSuccess + // 201: userObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -65,7 +65,7 @@ func initUserRoute(router chi.Router) { // This will create an user for organisation users library. // // Responses: - // 200: userObjectSuccess + // 201: userObjectSuccess // 422: wrongEntity // 503: databaseError // default: genericError @@ -316,7 +316,7 @@ func getUserFromRole(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.Role == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { @@ -338,13 +338,13 @@ func newUser(w http.ResponseWriter, r *http.Request) { db := dbStore.db request := r.Body err := chiRender.Bind(request, &data) - if err != nil { + if err != nil || data.User == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { err := store.User().Save(data.User, db) if err == nil { - render.JSON(w, 200, data.User) + render.JSON(w, 201, data.User) } else { render.JSON(w, err.StatusCode, err) } @@ -365,7 +365,7 @@ func updateUser(w http.ResponseWriter, r *http.Request) { request := r.Body err := chiRender.Bind(request, &data) user := r.Context().Value(oldUserKey).(models.User) - if err != nil { + if err != nil || data.User == nil { render.JSON(w, error422.StatusCode, error422) } else { if err := db.DB().Ping(); err == nil { diff --git a/scripts/slate_require.sh b/scripts/slate_require.sh index 77f14b1..c8da712 100755 --- a/scripts/slate_require.sh +++ b/scripts/slate_require.sh @@ -8,11 +8,8 @@ COMPOSER="docker run --rm --name composer -v $(pwd)/docker_resources/swagger:/ap sudo rm -rf ./docker_resources/slate_resources git clone https://github.com/tripit/slate.git ./docker_resources/slate_resources -# cd tmp -# cp -r deploy.sh config.rb font-selection.json Gemfile Gemfile.lock 'source' ../docker_resources/slate_resources - -# cd .. -# rm -rf tmp git clone https://github.com/E96/swagger2slate.git docker_resources/swagger $COMPOSER wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.1.6/swagger-codegen-cli-2.1.6.jar -O docker_resources/swagger/swagger-codegen-cli.jar + +go get -u github.com/go-swagger/go-swagger/cmd/swagger \ No newline at end of file diff --git a/swagger.yaml b/swagger.yaml index b2a0c69..2a46046 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -8,8 +8,8 @@ info: contact: name: "Titouan Freville" email: "titouanfreville@gmail.com" -host: "api.popcube" -basePath: "/alpha" +host: "api-alpha.popcube.xyz" +basePath: "/" schemes: - "http" - "https" @@ -73,7 +73,7 @@ paths: $ref: "#/definitions/Avatar" x-go-name: "Avatar" responses: - 200: + 201: description: "avatarObjectSuccess list of avatars" schema: $ref: "#/definitions/Avatar" @@ -187,7 +187,7 @@ paths: $ref: "#/definitions/Avatar" x-go-name: "Avatar" responses: - 200: + 201: description: "avatarObjectSuccess list of avatars" schema: $ref: "#/definitions/Avatar" @@ -371,7 +371,7 @@ paths: $ref: "#/definitions/Channel" x-go-name: "Channel" responses: - 200: + 201: description: "channelObjectSuccess list of channels" schema: $ref: "#/definitions/Channel" @@ -576,7 +576,7 @@ paths: $ref: "#/definitions/Emoji" x-go-name: "Emoji" responses: - 200: + 201: description: "emojiObjectSuccess list of emojis" schema: $ref: "#/definitions/Emoji" @@ -810,7 +810,7 @@ paths: $ref: "#/definitions/Folder" x-go-name: "Folder" responses: - 200: + 201: description: "folderObjectSuccess list of folders" schema: $ref: "#/definitions/Folder" @@ -960,7 +960,7 @@ paths: $ref: "#/definitions/Folder" x-go-name: "Folder" responses: - 200: + 201: description: "folderObjectSuccess list of folders" schema: $ref: "#/definitions/Folder" @@ -1114,7 +1114,7 @@ paths: $ref: "#/definitions/Member" x-go-name: "Member" responses: - 200: + 201: description: "memberObjectSuccess list of members" schema: $ref: "#/definitions/Member" @@ -1172,7 +1172,7 @@ paths: $ref: "#/definitions/Member" x-go-name: "Member" responses: - 200: + 201: description: "memberObjectSuccess list of members" schema: $ref: "#/definitions/Member" @@ -1263,7 +1263,7 @@ paths: $ref: "#/definitions/Message" x-go-name: "Message" responses: - 200: + 201: description: "messageObjectSuccess list of messages" schema: $ref: "#/definitions/Message" @@ -1351,7 +1351,7 @@ paths: $ref: "#/definitions/Message" x-go-name: "Message" responses: - 200: + 201: description: "messageObjectSuccess list of messages" schema: $ref: "#/definitions/Message" @@ -1448,7 +1448,7 @@ paths: $ref: "#/definitions/Organisation" x-go-name: "Organisation" responses: - 200: + 201: description: "organisationObjectSuccess list of organisations" schema: $ref: "#/definitions/Organisation" @@ -1505,7 +1505,7 @@ paths: $ref: "#/definitions/Organisation" x-go-name: "Organisation" responses: - 200: + 201: description: "organisationObjectSuccess list of organisations" schema: $ref: "#/definitions/Organisation" @@ -1607,7 +1607,7 @@ paths: $ref: "#/definitions/Parameter" x-go-name: "Parameter" responses: - 200: + 201: description: "parameterObjectSuccess list of parameters" schema: $ref: "#/definitions/Parameter" @@ -1663,7 +1663,7 @@ paths: $ref: "#/definitions/Parameter" x-go-name: "Parameter" responses: - 200: + 201: description: "parameterObjectSuccess list of parameters" schema: $ref: "#/definitions/Parameter" @@ -1741,7 +1741,7 @@ paths: operationId: "getAllRole" parameters: [] responses: - 200: + 201: description: "roleSlice Array of roles" schema: type: "array" @@ -1824,7 +1824,7 @@ paths: $ref: "#/definitions/Role" x-go-name: "Role" responses: - 200: + 201: description: "roleObjectSuccess list of roles" schema: $ref: "#/definitions/Role" @@ -1986,7 +1986,7 @@ paths: $ref: "#/definitions/User" x-go-name: "User" responses: - 200: + 201: description: "userObjectSuccess list of users" schema: $ref: "#/definitions/User" @@ -2124,7 +2124,7 @@ paths: $ref: "#/definitions/User" x-go-name: "User" responses: - 200: + 201: description: "userObjectSuccess list of users" schema: $ref: "#/definitions/User"