Annotation Interface OpenApi.Parameter
- Enclosing class:
OpenApi
On a method parameter, this annotation decorates the generated parameter from the declarative HTTP binding; it
cannot change the bound parameter name() or in() location. On a method, this annotation must
declare non-blank name() and in() values which match an existing generated path, query, header,
or cookie parameter.
Path parameters are always required and cannot be made optional. Query, header, and cookie parameters which are
required by the Java signature or HTTP binding cannot be made optional. allowReserved() can be used only
for query parameters. If content() is configured, style() and explode() must not be
configured.
Generated OpenAPI omits declarative header parameters named Accept, Content-Type, or
Authorization. Use media type metadata, request body metadata, or security metadata to describe those
concerns.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether reserved characters are allowed unencoded.Parameter content entries.booleanWhether the parameter is deprecated.Parameter example.Parameter examples.Parameter explode override.Parameter location.Parameter name.Requiredness override.Parameter style.Parameter description.
-
Element Details
-
value
-
name
String nameParameter name. Defaults to the HTTP binding name on parameter-target usage.Method-target usage requires a non-blank value matching a generated parameter. Parameter-target usage cannot override the generated parameter name.
- Returns:
- name
- Default:
""
-
in
String inParameter location. Defaults to the HTTP binding location on parameter-target usage.Method-target usage requires a non-blank value matching a generated parameter location. Supported generated locations are
path,query,header, andcookie. Parameter-target usage cannot override the generated parameter location.Declarative OpenAPI annotations do not support OpenAPI 3.2
querystringparameters. To use one, define the complete containing operation in a static OpenAPI document or anOpenApiDocumentSource, and configure Helidon not to generate the same path and method from annotations.- Returns:
- location
- Default:
""
-
required
OpenApi.Required requiredRequiredness override.Path parameters are always required. Required query, header, and cookie parameters cannot be made optional.
- Returns:
- requiredness
- Default:
UNSPECIFIED
-
example
String exampleParameter example.Mutually exclusive with
examples(). Can be used with generated schema parameters or explicitcontent().- Returns:
- example
- Default:
""
-
examples
OpenApi.Example[] examplesParameter examples.Mutually exclusive with
example(). Can be used with generated schema parameters or explicitcontent().- Returns:
- examples
- Default:
{}
-
content
OpenApi.Content[] contentParameter content entries.At most one entry is supported. When configured, generated schema,
style(), andexplode()are omitted. Parameterexample()orexamples()can still be configured.- Returns:
- content
- Default:
{}
-
style
OpenApi.Style styleParameter style.Must remain unspecified when
content()is configured. SeeOpenApi.Stylefor supported styles by parameter location.- Returns:
- style
- Default:
UNSPECIFIED
-
explode
OpenApi.Explode explodeParameter explode override.Must remain unspecified when
content()is configured. Header parameters cannot useOpenApi.Explode.TRUE. Query parameters cannot useOpenApi.Explode.TRUEwithOpenApi.Style.SPACE_DELIMITEDorOpenApi.Style.PIPE_DELIMITED.- Returns:
- explode
- Default:
UNSPECIFIED
-
allowReserved
boolean allowReservedWhether reserved characters are allowed unencoded.Supported only for query parameters.
- Returns:
- allow reserved flag
- Default:
false
-
deprecated
boolean deprecatedWhether the parameter is deprecated.- Returns:
- deprecated flag
- Default:
false
-