Skip to content

Commit

Permalink
Add additionalProperties to SchemaProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
Azquelt committed Apr 23, 2024
1 parent ad32d88 commit d8b3f62
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.eclipse.microprofile.openapi.annotations.ExternalDocumentation;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.extensions.Extension;
import org.eclipse.microprofile.openapi.annotations.media.Schema.False;
import org.eclipse.microprofile.openapi.annotations.media.Schema.True;

/**
* The SchemaProperty Object allows the definition of input and output data types nested within the
Expand Down Expand Up @@ -368,6 +370,32 @@
**/
boolean uniqueItems() default false;

/**
* Provides a Java class as implementation for additional properties that may be present in instances of this
* schema.
*
* <p>
* If no additional properties are allowed, the value of this property should be set to {@link False False.class}
* which will be rendered as boolean <code>false</code> in the resulting OpenAPI document.
*
* <p>
* The default value {@link Void Void.class} will result in no {@code additionalProperties} attribute being
* generated in the resulting OpenAPI document. The effective value in that case is {@code true} per the OpenAPI
* specification.
*
* <p>
* Implementations MAY ignore this property if this schema's {@linkplain #type() type} is not
* {@linkplain SchemaType#OBJECT OBJECT}, either explicitly or as derived by the placement of the annotation.
*
* @return a class that describes the allowable schema for additional properties not explicitly defined
*
* @since 4.0
*
* @see True
* @see False
*/
Class<?> additionalProperties() default Void.class;

/**
* List of extensions to be added to the {@link org.eclipse.microprofile.openapi.models.media.Schema Schema} model
* corresponding to the containing annotation.
Expand Down

0 comments on commit d8b3f62

Please sign in to comment.