-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Description
Is there an idiomatic way how to share Schemas not specific to any controller ? Like Error
definition. I found a way how to do it, but not sure if there is a better way/solution.
@doc false
def swagger_definitions do
%{
ApiToken:
JsonApi.resource do
description("Standard pong response")
attributes do
revoked(:boolean, "Is the API Token revoked?", default: false)
revoked_at(:string, "Date and time of API Token revocation",
format: "date-time",
default: nil
)
description(:string, "Description associated with API Token", default: nil)
issued_at(:string, "Date and time of API Token issuance",
format: "date-time",
default: nil
)
end
end,
Error: swagger_definitions_common()[:Error]
}
end
I have a swagger_definitions_common
in different module and I just import the function and call it to give me the Error schema for current controller.
Metadata
Metadata
Assignees
Labels
No labels