Schemas: Refactor to our naming scheme.
This commit is contained in:
parent
c40afe5ba0
commit
651935f137
|
@ -6,8 +6,8 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
|
||||||
alias OpenApiSpex.Operation
|
alias OpenApiSpex.Operation
|
||||||
alias OpenApiSpex.Schema
|
alias OpenApiSpex.Schema
|
||||||
alias Pleroma.Web.ApiSpec.Schemas.ChatMessageCreateRequest
|
alias Pleroma.Web.ApiSpec.Schemas.ChatMessageCreateRequest
|
||||||
alias Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse
|
alias Pleroma.Web.ApiSpec.Schemas.ChatMessage
|
||||||
alias Pleroma.Web.ApiSpec.Schemas.ChatResponse
|
alias Pleroma.Web.ApiSpec.Schemas.Chat
|
||||||
|
|
||||||
import Pleroma.Web.ApiSpec.Helpers
|
import Pleroma.Web.ApiSpec.Helpers
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ def create_operation do
|
||||||
Operation.response(
|
Operation.response(
|
||||||
"The created or existing chat",
|
"The created or existing chat",
|
||||||
"application/json",
|
"application/json",
|
||||||
ChatResponse
|
Chat
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
security: [
|
security: [
|
||||||
|
@ -103,7 +103,7 @@ def post_chat_message_operation do
|
||||||
Operation.response(
|
Operation.response(
|
||||||
"The newly created ChatMessage",
|
"The newly created ChatMessage",
|
||||||
"application/json",
|
"application/json",
|
||||||
ChatMessageResponse
|
ChatMessage
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
security: [
|
security: [
|
||||||
|
@ -119,7 +119,7 @@ def chats_response do
|
||||||
title: "ChatsResponse",
|
title: "ChatsResponse",
|
||||||
description: "Response schema for multiple Chats",
|
description: "Response schema for multiple Chats",
|
||||||
type: :array,
|
type: :array,
|
||||||
items: ChatResponse,
|
items: Chat,
|
||||||
example: [
|
example: [
|
||||||
%{
|
%{
|
||||||
"account" => %{
|
"account" => %{
|
||||||
|
@ -180,7 +180,7 @@ def chat_messages_response do
|
||||||
title: "ChatMessagesResponse",
|
title: "ChatMessagesResponse",
|
||||||
description: "Response schema for multiple ChatMessages",
|
description: "Response schema for multiple ChatMessages",
|
||||||
type: :array,
|
type: :array,
|
||||||
items: ChatMessageResponse,
|
items: ChatMessage,
|
||||||
example: [
|
example: [
|
||||||
%{
|
%{
|
||||||
"emojis" => [
|
"emojis" => [
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Web.ApiSpec.Schemas.ChatResponse do
|
defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
|
||||||
alias OpenApiSpex.Schema
|
alias OpenApiSpex.Schema
|
||||||
|
|
||||||
require OpenApiSpex
|
require OpenApiSpex
|
||||||
|
|
||||||
OpenApiSpex.schema(%{
|
OpenApiSpex.schema(%{
|
||||||
title: "ChatResponse",
|
title: "Chat",
|
||||||
description: "Response schema for a Chat",
|
description: "Response schema for a Chat",
|
||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
|
@ -2,13 +2,13 @@
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessageResponse do
|
defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
|
||||||
alias OpenApiSpex.Schema
|
alias OpenApiSpex.Schema
|
||||||
|
|
||||||
require OpenApiSpex
|
require OpenApiSpex
|
||||||
|
|
||||||
OpenApiSpex.schema(%{
|
OpenApiSpex.schema(%{
|
||||||
title: "ChatMessageResponse",
|
title: "ChatMessage",
|
||||||
description: "Response schema for a ChatMessage",
|
description: "Response schema for a ChatMessage",
|
||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
Loading…
Reference in New Issue