Skip to content

Commit

Permalink
Use Signal as example App
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkonidas committed Sep 8, 2024
1 parent 356095c commit 34811cf
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions lib/plexus_web/controllers/api/v1/app_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions lib/plexus_web/controllers/api/v1/schemas/app.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions lib/plexus_web/controllers/api/v1/schemas/app_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ 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
},
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"
}
]
}
Expand Down
22 changes: 11 additions & 11 deletions lib/plexus_web/controllers/api/v1/schemas/apps_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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
Expand Down

0 comments on commit 34811cf

Please sign in to comment.