diff --git a/lib/trento_web/controllers/host_controller.ex b/lib/trento_web/controllers/host_controller.ex index 15046bb314..4021245ea9 100644 --- a/lib/trento_web/controllers/host_controller.ex +++ b/lib/trento_web/controllers/host_controller.ex @@ -18,7 +18,7 @@ defmodule TrentoWeb.HostController do responses: [ ok: {"A collection of the discovered hosts", "application/json", - TrentoWeb.OpenApi.Schema.Host.Collection} + TrentoWeb.OpenApi.Schema.Host.HostsCollection} ] @spec list(Plug.Conn.t(), map) :: Plug.Conn.t() diff --git a/lib/trento_web/openapi/schema/host.ex b/lib/trento_web/openapi/schema/host.ex index 4643bed282..616cfe6b95 100644 --- a/lib/trento_web/openapi/schema/host.ex +++ b/lib/trento_web/openapi/schema/host.ex @@ -24,7 +24,7 @@ defmodule TrentoWeb.OpenApi.Schema.Host do }) end - defmodule Item do + defmodule HostItem do @moduledoc false OpenApiSpex.schema(%{ @@ -33,7 +33,6 @@ defmodule TrentoWeb.OpenApi.Schema.Host do type: :object, properties: %{ id: %Schema{type: :integer, description: "Host ID"}, - # pattern: ~r/[a-zA-Z][a-zA-Z0-9_]+/ hostname: %Schema{type: :string, description: "Host name"}, ip_addresses: %Schema{ type: :array, @@ -80,18 +79,17 @@ defmodule TrentoWeb.OpenApi.Schema.Host do items: TrentoWeb.OpenApi.Schema.SlesSubscription } } - # required: [:name, :email], }) end - defmodule Collection do + defmodule HostsCollection do @moduledoc false OpenApiSpex.schema(%{ title: "HostsCollection", description: "A list of the discovered hosts", type: :array, - items: Item + items: HostItem }) end end