{8.2.0-updated} @Header

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

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

##### Example:

@Remote(path="/myproxy") public interface MyProxy { // Explicit names specified for HTTP headers. // pojo will be converted to UON notation (unless plain-text parts enabled). @RemoteMethod(path="/mymethod1") String myProxyMethod1(@Header("Foo") String foo, @Header("Bar") MyPojo pojo); // Multiple values pulled from a HeaderSupplier object. // Same as @Header("*"). @RemoteMethod(path="/mymethod2") String myProxyMethod2(@Header HeaderSupplier headerSupplier); // Multiple values pulled from a Map. // Same as @Header("*"). @RemoteMethod(path="/mymethod3") String myProxyMethod3(@Header Map<String,Object> map); // Multiple values pulled from a bean. // Same as @Header("*"). @RemoteMethod(path="/mymethod4") String myProxyMethod4(@Header MyBean myBean); }

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.Header#serializer() @Header(serializer)} annotation.

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

- {@link oaj.http.HeaderSupplier} - Serialized as individual headers.
- 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).

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

- {@doc OpenApiSerializers}