PhoenixSwagger.Schema.additional_properties

You're seeing just the function additional_properties, go back to PhoenixSwagger.Schema module for more information.
Link to this function

additional_properties(model, bool_or_schema)

View Source

Boolean indicating that additional properties are allowed, or a schema to be used for validating any additional properties not listed in properties.

Default behaviour is to allow additional properties.

Examples

iex> alias PhoenixSwagger.Schema
...> %Schema{type: :object}
...> |> Schema.property(:name, :string, "Full name", maxLength: 255)
...> |> Schema.additional_properties(false)
%PhoenixSwagger.Schema{
  type: :object,
  properties: %{
    name: %PhoenixSwagger.Schema{
      type: :string,
      description: "Full name",
      maxLength: 255
    }
  },
  additionalProperties: false
}

iex> alias PhoenixSwagger.Schema
...> %Schema{type: :object}
...> |> Schema.property(:name, :string, "Full name", maxLength: 255)
...> |> Schema.additional_properties(%Schema{type: :number})
%PhoenixSwagger.Schema{
  type: :object,
  properties: %{
    name: %PhoenixSwagger.Schema{
      type: :string,
      description: "Full name",
      maxLength: 255
    }
  },
  additionalProperties: %PhoenixSwagger.Schema{
    type: :number
  }
}