Skip to content

Commit

Permalink
Added missing bad request case doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed May 17, 2022
1 parent 99466dd commit 9bc53ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/trento_web/controllers/catalog_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ defmodule TrentoWeb.CatalogController do
],
responses: [
ok: {"A Collection of the available Checks", "application/json", ChecksCatalog.Catalog},
not_found: {"Not found", "application/json", ChecksCatalog.CatalogNotfound}
not_found: {"Not found", "application/json", ChecksCatalog.CatalogNotfound},
bad_request: {"Bad Request", "application/json", ChecksCatalog.UnableToLoadCatalog}
]
)

Expand Down
14 changes: 14 additions & 0 deletions lib/trento_web/openapi/schema/checks_catalog.ex
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,18 @@ defmodule TrentoWeb.OpenApi.Schema.ChecksCatalog do
example: %{error: "not_found"}
})
end

defmodule UnableToLoadCatalog do
@moduledoc false

OpenApiSpex.schema(%{
title: "UnableToLoadCatalog",
description: "Something wrong happened while loading the catalog. ie: it is not ready yet",
type: :object,
properties: %{
error: %Schema{type: :string, description: "The error message"}
},
example: %{error: "(not_ready|some other error message)"}
})
end
end

0 comments on commit 9bc53ba

Please sign in to comment.