Annotation Type Extension
-
@Target({FIELD,METHOD,PARAMETER,TYPE}) @Retention(RUNTIME) @Repeatable(Extensions.class) public @interface Extension
A named extension that should be added to the OpenAPI definition. The names of all extensions MUST begin withx-
or else an invalid document will potentially be created.Although this annotation may currently be placed directly on a Java language element target, application developers should instead utilize the
extensions
property of the particular annotation that corresponds to the model being extended. Use of the annotation directly on a Java element is often ambiguous and it may result in the extension being added to an incorrect location in the OpenAPI model. Future releases of MicroProfile OpenAPI may remove the capability of placing this annotation directly on a Java element.When
@Extension
annotations are used both directly on a Java element as well as within another annotation that targets the same Java element, implementations will apply only the nested extensions to the resulting model.Example of preferred use with
@Extension
nested within an@Schema
annotation:class MyPojo { @Schema( type = SchemaType.STRING, extensions = @Extension( name = "x-custom-property", value = "custom-value") String property1; }
Example of deprecated use with
@Extension
placed directly on a field implied to be a schema property:class MyPojo { @Extension( name = "x-custom-property", value = "custom-value") String property1; }
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
parseValue
Should the value be parsed into an object/array or other simple type (number, boolean, etc) or left as a simple String.
-
-
-
-
parseValue
boolean parseValue
Should the value be parsed into an object/array or other simple type (number, boolean, etc) or left as a simple String. If this is true, then the value must be parseable as one of:- JSON object
- JSON array
- number
- boolean
- Returns:
- true if the value should be parsed
- Default:
- false
-
-