PhoenixSwagger.Schema.property
You're seeing just the function
property
, go back to PhoenixSwagger.Schema module for more information.
Link to this function
property(model, name, type_or_schema, description \\ nil, opts \\ [])
View SourceSets a property of the Schema.
Examples
iex> alias PhoenixSwagger.Schema
...> %Schema{type: :object}
...> |> Schema.property(:name, :string, "Full name", required: true, maxLength: 256)
...> |> Schema.property(:address, [:string, "null"], "Street Address")
...> |> Schema.property(:friends, Schema.array(:User), "Friends list", required: true)
%PhoenixSwagger.Schema{
type: :object,
properties: %{
friends: %PhoenixSwagger.Schema{
type: :array,
description: "Friends list",
items: %PhoenixSwagger.Schema{"$ref": "#/definitions/User"}
},
address: %PhoenixSwagger.Schema{
type: [:string, "null"],
description: "Street Address"
},
name: %PhoenixSwagger.Schema{
type: :string,
description: "Full name",
maxLength: 256
}
},
required: [:friends, :name]
}