module OpenAPI::Generator::Helpers::Lucky
Defined in:
openapi-generator/helpers/lucky.cropenapi-generator/helpers/lucky/body.cr
openapi-generator/helpers/lucky/query_params.cr
openapi-generator/helpers/lucky/responses.cr
Class Method Summary
-
.bootstrap
Run this method exactly once before generating the schema to register all the inferred properties.
Macro Summary
-
body_as(type, description = nil, content_type = "application/json", constructor = :from_json)
Extracts and serialize the body from the request and registers it in the OpenAPI operation.
-
body_as!(*args, **named_args)
Same as
body_as
but will raise if the body is missing or badly formatted. -
head(status, description = nil, headers = nil, links = nil)
Declare a head response.
-
json(body, status = 200, description = nil, type = nil, schema = nil, headers = nil, links = nil)
Declare a json response.
-
param(declaration, description = nil, multiple = false, schema = nil, **args)
Declare a query parameter.
-
plain_text(body, status = 200, description = nil, type = String, schema = nil, headers = nil, links = nil)
Declare a plain text response.
-
xml(body, status = 200, description = nil, type = String, schema = nil, headers = nil, links = nil)
Declare an xml response.
Class Method Detail
Run this method exactly once before generating the schema to register all the inferred properties.
Macro Detail
Extracts and serialize the body from the request and registers it in the OpenAPI operation.
# This will try to case the body as a SomeClass using the SomeClass.new method and assuming that the payload is a json.
body_as SomeClass, description: "Some payload.", content_type: "application/json", constructor: from_json
# The content_type, constructor and description can be omitted.
body_as SomeClass
Same as body_as
but will raise if the body is missing or badly formatted.
Declare a json response.
Declare a query parameter.
Declare a plain text response.
Declare an xml response.