From 366a7ede20dd76b3f912ae6ccbe0b0e48d370ed2 Mon Sep 17 00:00:00 2001 From: Wannes Gennar Date: Mon, 4 Mar 2024 09:23:43 +0100 Subject: [PATCH] add missing message property to schema --- .../schemas/global_event_schema.ex | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/helldivers_2_web/schemas/global_event_schema.ex b/lib/helldivers_2_web/schemas/global_event_schema.ex index 52512cd..a854062 100644 --- a/lib/helldivers_2_web/schemas/global_event_schema.ex +++ b/lib/helldivers_2_web/schemas/global_event_schema.ex @@ -4,9 +4,15 @@ defmodule Helldivers2Web.Schemas.GlobalEventSchema do require OpenApiSpex @doc "Generates a schema for a single homeworld schema response" - def response(), do: {"Global event response", "application/json", __MODULE__, Helldivers2Web.ApiSpec.default_options()} + def response(), + do: + {"Global event response", "application/json", __MODULE__, + Helldivers2Web.ApiSpec.default_options()} - def responses(), do: {"Global events response", "application/json", %Schema{type: :array, items: __MODULE__}, Helldivers2Web.ApiSpec.default_options()} + def responses(), + do: + {"Global events response", "application/json", %Schema{type: :array, items: __MODULE__}, + Helldivers2Web.ApiSpec.default_options()} OpenApiSpex.schema(%{ description: "Contains information about a global event, past and present", @@ -30,6 +36,15 @@ defmodule Helldivers2Web.Schemas.GlobalEventSchema do description: "Internal identifier of the title, this always remains the same regardless of language" }, + message: %Schema{ + type: :string, + description: "The message from Super Earth about the global event" + }, + message_id_32: %Schema{ + type: :integer, + description: + "Internal identifier of the message, this always remains the same regardless of language" + }, race: %Schema{ type: :string, description: "The race involved in this campaign (so far seems to always be 'Human')"