annotation Athena::Framework::Annotations::View
#
Configures how the ATH::View::ViewHandlerInterface
should render the related controller action.
Fields#
- status :
HTTP::Status
- TheHTTP::Status
the endpoint should return. Defaults toHTTP::Status::OK
(200). - serialization_groups :
Array(String)?
- The serialization groups to use for this route as part ofASR::ExclusionStrategies::Groups
. - validation_groups :
Array(String)?
- Groups that should be used to validate any objects related to this route; seeAVD::Constraint@validation-groups
. - emit_nil :
Bool
- Ifnil
values should be serialized. Defaults tofalse
.
Example#
@[ARTA::Post(path: "/publish/{id}")]
@[ATHA::View(status: :accepted, serialization_groups: ["default", "detailed"])]
def publish(id : Int32) : Article
article = Article.find id
article.published = true
article
end