From 34811cf2f3e96d69b1191da24b2669ed4458b688 Mon Sep 17 00:00:00 2001 From: Tom Konidas Date: Sun, 8 Sep 2024 10:25:03 -0400 Subject: [PATCH] Use Signal as example App --- .../controllers/api/v1/app_controller.ex | 8 +++---- .../controllers/api/v1/schemas/app.ex | 18 +++++++-------- .../api/v1/schemas/app_response.ex | 20 ++++++++--------- .../api/v1/schemas/apps_response.ex | 22 +++++++++---------- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/plexus_web/controllers/api/v1/app_controller.ex b/lib/plexus_web/controllers/api/v1/app_controller.ex index 8914b46..70f3b14 100644 --- a/lib/plexus_web/controllers/api/v1/app_controller.ex +++ b/lib/plexus_web/controllers/api/v1/app_controller.ex @@ -14,10 +14,10 @@ defmodule PlexusWeb.API.V1.AppController do operation :index, summary: "List Applications", parameters: [ - page: [in: :query, description: "Page number", type: :integer, example: 2], + page: [in: :query, description: "Page number", type: :integer, example: 1], limit: [in: :query, description: "Max results per page", type: :integer, example: 25], scores: [in: :query, description: "Include scores", type: :boolean, example: true], - q: [in: :query, description: "Search query", type: :string, example: "YouTube"] + q: [in: :query, description: "Search query", type: :string, example: "Signal"] ], responses: [ ok: {"Applications", "application/json", AppsResponse} @@ -55,12 +55,12 @@ defmodule PlexusWeb.API.V1.AppController do description: "App Package", type: :string, required: true, - example: "com.google.android.youtube" + example: "org.thoughtcrime.securesms" ], scores: [in: :query, description: "Include scores", type: :boolean, example: true] ], responses: [ - ok: {"Applications", "application/json", AppResponse} + ok: {"Application", "application/json", AppResponse} ] def show(conn, %{"package" => package} = params) do diff --git a/lib/plexus_web/controllers/api/v1/schemas/app.ex b/lib/plexus_web/controllers/api/v1/schemas/app.ex index 0ca9546..8cbfb14 100644 --- a/lib/plexus_web/controllers/api/v1/schemas/app.ex +++ b/lib/plexus_web/controllers/api/v1/schemas/app.ex @@ -14,24 +14,24 @@ defmodule PlexusWeb.API.V1.Schemas.App do scores: AverageScores }, example: %{ - "name" => "YouTube Music", - "package" => "com.google.android.youtube.tvmusic", + "name" => "Signal", + "package" => "org.thoughtcrime.securesms", "scores" => %{ "native" => %{ "rating_type" => "native", - "numerator" => 1.2, - "total_count" => 21, - "denominator" => 4 + "numerator" => 3.86, + "denominator" => 4, + "total_count" => 28 }, "micro_g" => %{ "rating_type" => "micro_g", - "numerator" => 4.0, - "total_count" => 44, - "denominator" => 4 + "numerator" => 3.92, + "denominator" => 4, + "total_count" => 25 } }, "icon_url" => - "https://play-lh.googleusercontent.com/76AjYITcB0dI0sFqdQjNgXQxRMlDIswbp0BAU_O5Oob-73b6cqKggVlAiNXQAW5Bl1g" + "https://play-lh.googleusercontent.com/jCln_XT8Ruzp7loH1S6yM-ZzzpLP1kZ3CCdXVEo0tP2w5HNtWQds6lo6aLxLIjiW_X8" } }) end diff --git a/lib/plexus_web/controllers/api/v1/schemas/app_response.ex b/lib/plexus_web/controllers/api/v1/schemas/app_response.ex index 5a4eb37..07164c6 100644 --- a/lib/plexus_web/controllers/api/v1/schemas/app_response.ex +++ b/lib/plexus_web/controllers/api/v1/schemas/app_response.ex @@ -4,7 +4,7 @@ defmodule PlexusWeb.API.V1.Schemas.AppResponse do OpenApiSpex.schema(%{ title: "AppResponse", - description: "Response schema for an application", + description: "Response Schema for an Application", type: :object, properties: %{ data: App @@ -12,24 +12,24 @@ defmodule PlexusWeb.API.V1.Schemas.AppResponse do example: %{ "data" => [ %{ - "name" => "YouTube Music", - "package" => "com.google.android.youtube.tvmusic", + "name" => "Signal", + "package" => "org.thoughtcrime.securesms", "scores" => %{ "native" => %{ "rating_type" => "native", - "numerator" => 1.2, - "total_count" => 21, - "denominator" => 4 + "numerator" => 3.86, + "denominator" => 4, + "total_count" => 28 }, "micro_g" => %{ "rating_type" => "micro_g", - "numerator" => 3.9, - "total_count" => 44, - "denominator" => 4 + "numerator" => 3.92, + "denominator" => 4, + "total_count" => 25 } }, "icon_url" => - "https://play-lh.googleusercontent.com/lMoItBgdPPVDJsNOVtP26EKHePkwBg-PkuY9NOrc-fumRtTFP4XhpUNk_22syN4Datc" + "https://play-lh.googleusercontent.com/jCln_XT8Ruzp7loH1S6yM-ZzzpLP1kZ3CCdXVEo0tP2w5HNtWQds6lo6aLxLIjiW_X8" } ] } diff --git a/lib/plexus_web/controllers/api/v1/schemas/apps_response.ex b/lib/plexus_web/controllers/api/v1/schemas/apps_response.ex index 7e027de..6e6777f 100644 --- a/lib/plexus_web/controllers/api/v1/schemas/apps_response.ex +++ b/lib/plexus_web/controllers/api/v1/schemas/apps_response.ex @@ -6,7 +6,7 @@ defmodule PlexusWeb.API.V1.Schemas.AppsResponse do OpenApiSpex.schema(%{ title: "AppsResponse", - description: "Response schema for a list of applications", + description: "Response Schema for a List of Applications", type: :object, properties: %{ data: %Schema{type: :array, items: App}, @@ -15,28 +15,28 @@ defmodule PlexusWeb.API.V1.Schemas.AppsResponse do example: %{ "data" => [ %{ - "name" => "YouTube Music", - "package" => "com.google.android.youtube.tvmusic", + "name" => "Signal", + "package" => "org.thoughtcrime.securesms", "scores" => %{ "native" => %{ "rating_type" => "native", - "numerator" => 1.1, - "total_count" => 21, - "denominator" => 4 + "numerator" => 3.86, + "denominator" => 4, + "total_count" => 28 }, "micro_g" => %{ "rating_type" => "micro_g", - "numerator" => 3.7, - "total_count" => 43, - "denominator" => 4 + "numerator" => 3.92, + "denominator" => 4, + "total_count" => 25 } }, "icon_url" => - "https://play-lh.googleusercontent.com/76AjYITcB0dI0sFqdQjNgXQxRMlDIswbp0BAU_O5Oob-73b6cqKggVlAiNXQAW5Bl1g" + "https://play-lh.googleusercontent.com/jCln_XT8Ruzp7loH1S6yM-ZzzpLP1kZ3CCdXVEo0tP2w5HNtWQds6lo6aLxLIjiW_X8" } ], "meta" => %{ - "page_number" => 3, + "page_number" => 1, "limit" => 1, "total_count" => 420, "total_pages" => 69