Schemas: Refactor to our naming scheme.
authorlain <lain@soykaf.club>
Mon, 4 May 2020 09:08:00 +0000 (11:08 +0200)
committerlain <lain@soykaf.club>
Mon, 4 May 2020 09:08:00 +0000 (11:08 +0200)
lib/pleroma/web/api_spec/operations/chat_operation.ex
lib/pleroma/web/api_spec/schemas/chat.ex [moved from lib/pleroma/web/api_spec/schemas/chat_response.ex with 96% similarity]
lib/pleroma/web/api_spec/schemas/chat_message.ex [moved from lib/pleroma/web/api_spec/schemas/chat_message_response.ex with 91% similarity]

index 88b9db048af40396e9d86d0b66f27fd18965a56e..fc9d4608acef5cc00f0d40cabc4e98f23a823c56 100644 (file)
@@ -6,8 +6,8 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
   alias OpenApiSpex.Operation
   alias OpenApiSpex.Schema
   alias Pleroma.Web.ApiSpec.Schemas.ChatMessageCreateRequest
-  alias Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse
-  alias Pleroma.Web.ApiSpec.Schemas.ChatResponse
+  alias Pleroma.Web.ApiSpec.Schemas.ChatMessage
+  alias Pleroma.Web.ApiSpec.Schemas.Chat
 
   import Pleroma.Web.ApiSpec.Helpers
 
@@ -37,7 +37,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
           Operation.response(
             "The created or existing chat",
             "application/json",
-            ChatResponse
+            Chat
           )
       },
       security: [
@@ -103,7 +103,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
           Operation.response(
             "The newly created ChatMessage",
             "application/json",
-            ChatMessageResponse
+            ChatMessage
           )
       },
       security: [
@@ -119,7 +119,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
       title: "ChatsResponse",
       description: "Response schema for multiple Chats",
       type: :array,
-      items: ChatResponse,
+      items: Chat,
       example: [
         %{
           "account" => %{
@@ -180,7 +180,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
       title: "ChatMessagesResponse",
       description: "Response schema for multiple ChatMessages",
       type: :array,
-      items: ChatMessageResponse,
+      items: ChatMessage,
       example: [
         %{
           "emojis" => [
similarity index 96%
rename from lib/pleroma/web/api_spec/schemas/chat_response.ex
rename to lib/pleroma/web/api_spec/schemas/chat.ex
index aa435165daa54d6d173638ea9195756df351b39c..4d385d6ab816590c9b9e5f2477973d5d15188442 100644 (file)
@@ -2,13 +2,13 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ApiSpec.Schemas.ChatResponse do
+defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
   alias OpenApiSpex.Schema
 
   require OpenApiSpex
 
   OpenApiSpex.schema(%{
-    title: "ChatResponse",
+    title: "Chat",
     description: "Response schema for a Chat",
     type: :object,
     properties: %{
similarity index 91%
rename from lib/pleroma/web/api_spec/schemas/chat_message_response.ex
rename to lib/pleroma/web/api_spec/schemas/chat_message.ex
index 707c9808bbde1555eab3d24e3c2ad17ceeb9eb86..7c93b0c839b45418e839c7cfdecbb04eb8869aa0 100644 (file)
@@ -2,13 +2,13 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse do
+defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
   alias OpenApiSpex.Schema
 
   require OpenApiSpex
 
   OpenApiSpex.schema(%{
-    title: "ChatMessageResponse",
+    title: "ChatMessage",
     description: "Response schema for a ChatMessage",
     type: :object,
     properties: %{