{8.2.0-updated} @FormData

The {@link oaj.http.annotation.FormData @FormData} annotation can be applied to arguments of @RemoteMethod-annotated methods to denote that they are form-data parameters on the request.

- {@link oaj.http.annotation.FormData}
  - {@link oaj.http.annotation.FormData#_default() _default}, {@link oaj.http.annotation.FormData#df() df} - Default value if not present.
  - {@link oaj.http.annotation.FormData#_enum() _enum}, {@link oaj.http.annotation.FormData#e() e} - Input validation. Must match one of the values.
  - {@link oaj.http.annotation.FormData#allowEmptyValue() allowEmptyValue}, {@link oaj.http.annotation.FormData#aev() aev} - Input validation. Allow empty value.
  - {@link oaj.http.annotation.FormData#collectionFormat() collectionFormat}, {@link oaj.http.annotation.FormData#cf() cf} - How collections of items are formatted.
  - {@link oaj.http.annotation.FormData#exclusiveMaximum() exclusiveMaximum}, {@link oaj.http.annotation.FormData#emax() emax} - Input validation. Whether maximum is exclusive.
  - {@link oaj.http.annotation.FormData#exclusiveMinimum() exclusiveMinimum}, {@link oaj.http.annotation.FormData#emin() emin} - Input validation. Whether minimum is exclusive.
  - {@link oaj.http.annotation.FormData#format() format}, {@link oaj.http.annotation.FormData#f() f} - The schema type format.
  - {@link oaj.http.annotation.FormData#items() items} - The schema of items in a collection.
  - {@link oaj.http.annotation.FormData#maximum() maximum}, {@link oaj.http.annotation.FormData#max() max} - Input validation. Maximum numeric value.
  - {@link oaj.http.annotation.FormData#maxItems() maxItems}, {@link oaj.http.annotation.FormData#maxi() maxi} - Input validation. Maximum number of items in a collection.
  - {@link oaj.http.annotation.FormData#maxLength() maxLength}, {@link oaj.http.annotation.FormData#maxl() maxl} - Input validation. Maximum length of a string.
  - {@link oaj.http.annotation.FormData#minimum() minimum}, {@link oaj.http.annotation.FormData#min() min} - Input validation. Minimum numeric value.
  - {@link oaj.http.annotation.FormData#minItems() minItems}, {@link oaj.http.annotation.FormData#mini() mini} - Input validation. Minimum number of items in a collection.
  - {@link oaj.http.annotation.FormData#minLength() minLength}, {@link oaj.http.annotation.FormData#minl() minl} - Input validation. Minimum length of a string.
  - {@link oaj.http.annotation.FormData#multipleOf() multipleOf}, {@link oaj.http.annotation.FormData#mo() mo} - Input validation. Number must be a multiple of.
  - {@link oaj.http.annotation.FormData#name() name}, {@link oaj.http.annotation.FormData#n() n} - Form data entry name.
  - {@link oaj.http.annotation.FormData#pattern() pattern}, {@link oaj.http.annotation.FormData#p() p} - Input validation. Must match regular expression.
  - {@link oaj.http.annotation.FormData#required() required}, {@link oaj.http.annotation.FormData#r() r} - Input validation. Form data entry must be present.
  - {@link oaj.http.annotation.FormData#serializer() serializer} - Override the part serializer.
  - {@link oaj.http.annotation.FormData#skipIfEmpty() skipIfEmpty}, {@link oaj.http.annotation.FormData#sie() sie} - Don't add if value is null or empty.
  - {@link oaj.http.annotation.FormData#type() type}, {@link oaj.http.annotation.FormData#t() t} - The schema type.
  - {@link oaj.http.annotation.FormData#uniqueItems() uniqueItems}, {@link oaj.http.annotation.FormData#ui() ui} - Input validation. Collections must contain unique items only.

##### Example:

@Remote(path="/myproxy") public interface MyProxy { // Explicit names specified for form data parameters. @RemoteMethod String postParameters( @FormData("foo") String foo, @FormData("bar") MyPojo pojo ); // Multiple values pulled from a NameValuePairSupplier object. // Name "*" is inferred. @RemoteMethod String postNameValuePairs(@FormData NameValuePairSupplier nameValuePairSupplier); // Multiple values pulled from a Map. @RemoteMethod String postMap(@FormData Map<String,Object> map); // Multiple values pulled from a bean. @RemoteMethod String postBean(@FormData MyBean bean); // An entire form-data HTTP body as a String. @RemoteMethod String postString(@FormData String string); // An entire form-data HTTP body as a Reader. @RemoteMethod String postReader(@FormData Reader reader); }

Single-part arguments (i.e. those with name != "*") can be any of the following types:

- Any serializable POJO - Converted to a string using the {@link oaj.httppart.HttpPartSerializer} registered with the RestClient ({@link oaj.oapi.OpenApiSerializer} by default) or associated via the {@link oaj.http.annotation.FormData#serializer() @FormData(serializer)} annotation.

Multi-part arguments (i.e. those with name == "*" or empty) can be any of the following types:

- {@link java.io.Reader} - Raw contents of {@code Reader} will be serialized to remote resource.
- {@link java.io.InputStream} - Raw contents of {@code InputStream} will be serialized to remote resource.
- {@link oaj.http.NameValuePairSupplier} - Converted to a URL-encoded FORM post.
- Map - Converted to key-value pairs.
  Values serialized using the registered {@link oaj.httppart.HttpPartSerializer} ({@link oaj.oapi.OpenApiSerializer} by default).
- Bean - Converted to key-value pairs.
  Values serialized using the registered {@link oaj.httppart.HttpPartSerializer} ({@link oaj.oapi.OpenApiSerializer} by default).
- CharSequence - Used directly as am "application/x-www-form-urlencoded" entity.

See the link below for information about supported data types in OpenAPI serialization.

- {@doc OpenApiSerializers}