{new} @Body
The {@link oaj.http.annotation.Body @Body} annotation is used to identify POJOs to be used as the body of an HTTP request.
This is functionally equivalent to the following code:
Any of the following types can be used for the parameter or POJO class (matched in the specified order):
Content-Type is ignored.
Content-Type is ignored.
Content-Type is required to identify correct parser.
public T(Reader in) {...}
public static T create (Reader in) {...}
public static T fromReader (Reader in) {...}
Content-Type must not be present or match an existing parser so that it's not parsed as a POJO.
public T(InputStream in) {...}
public static T create (InputStream in) {...}
public static T fromInputStream (InputStream in) {...}
Content-Type must not be present or match an existing parser so that it's not parsed as a POJO.
public T(String in) {...}
public static T create (String in) {...}
public static T fromString (String in) {...}
public static T parse (String in) {...}
public static T parseString (String in) {...}
public static T forName (String in) {...}
public static T forString (String in) {...}
The {@link oaj.oapi.OpenApiSerializer} class can be used to serialize HTTP bodies to OpenAPI-based output.
For example, the following shows how a pipe-delimited list of comma-delimited numbers (e.g. Longs:
Input will be converted based on the types and formats defined in the schema definition.
Input validations such as minLength/maxLength that don't match the input will result in automatic 400 Bad Request responses.
For more information about valid parameter types when using OpenAPI parsing, see {@doc juneau-marshall.OpenApiDetails.Parsers OpenAPI Parsers}
The
This information is used to populate the auto-generated Swagger documentation and UI.
{@doc DefaultRestSvlVariables} (e.g. "$L{my.localized.variable}") are supported on annotation fields.