PhoenixSwagger.JsonApi.attributes
You're seeing just the macro
attributes
, go back to PhoenixSwagger.JsonApi module for more information.
Defines a block of attributes for a JSON-API resource.
Within this block, each function call will be translated into a
call to the PhoenixSwagger.JsonApi.attribute
function.
Examples
description("A User")
attributes do
name :string, "Full name of the user", required: true
dateOfBirth :string, "Date of Birth", format: "ISO-8601", required: false
end
Translates to:
description("A User")
|> attribute(:name, :string, "Full name of the user", required: true)
|> attribute(:dateOfBirth, :string, "Date of Birth", format: "ISO-8601", required: false)