PhoenixSwagger.Schema.discriminator
You're seeing just the function
discriminator
, go back to PhoenixSwagger.Schema module for more information.
Specifies the name of a property that identifies the polymorphic schema for a JSON object.
The value of this property should be the name of this schema, or another schema that inherits
from this schema using all_of
.
See http://swagger.io/specification/#composition-and-inheritance--polymorphism--83
Examples
iex> alias PhoenixSwagger.Schema
...> %Schema{}
...> |> Schema.type(:object)
...> |> Schema.title("Pet")
...> |> Schema.property(:pet_type, :string, "polymorphic pet schema type", example: "Dog")
...> |> Schema.discriminator(:pet_type)
%Schema{
type: :object,
title: "Pet",
properties: %{
pet_type: %Schema{
type: :string,
description: "polymorphic pet schema type",
example: "Dog"
}
},
discriminator: :pet_type,
required: [:pet_type]
}