{8.1.0-updated} @FormData
The {@link oaj.http.annotation.FormData @FormData} annotation is used to retrieve request form post entries.
The most typical scenario is to simply use the
This is functionally equivalent to the following code:
The special name
The registered {@link oajr.RestContext#REST_partParser REST_partParser} is used to convert strings to POJOs and controls what POJO types are supported. By default, this is the {@link oaj.oapi.OpenApiParser} which supports the standard Swagger-based rules for parsing.
For example, the following shows how a pipe-delimited list of comma-delimited numbers (e.g.
Input will be converted based on the types and formats defined in the schema definition.
Input validations such as
For more information about valid parameter types, see {@doc OpenApiParsers OpenAPI Parsers}
The
{@doc RestSvlVariables} (e.g. "$L{my.localized.variable}") are supported on annotation fields.
List<MyBean>
. This is due to the fact that Spring uses CGLIB to recompile classes
at runtime, and CGLIB was written before generics were introduced into Java and is a virtually-unsupported library.
Therefore, parameterized types will often be stripped from class definitions and replaced with unparameterized types
(e.g. List
). Under these circumstances, you are likely to get ClassCastExceptions
when trying to access generalized OMaps
as beans. The best solution to this issue is to either
specify the parameter as a bean array (e.g. MyBean[]
) or declare the method as final so that CGLIB
will not try to recompile it.