Skip to content

Commit 09028ff

Browse files
authored
Mark allowEmptyValue as deprecated in Header annotation and model (#730)
Signed-off-by: Michael Edgar <michael@xlate.io>
1 parent 5866881 commit 09028ff

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

api/src/main/java/org/eclipse/microprofile/openapi/annotations/headers/Header.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@
8787
* is present. This may create validation errors when the header is required.
8888
*
8989
* @return whether or not the header allows empty values
90+
*
91+
* @deprecated The OpenAPI specification states that {@code allowEmptyValue} is only valid for {@code query}
92+
* parameters. As the {@code Header} model is a specialized {@code Parameter}, this attribute is not
93+
* valid and should not be used. Removal of this property is planned for the next major release of
94+
* MicroProfile OpenAPI.
9095
**/
96+
@Deprecated(since = "4.2", forRemoval = true)
9197
boolean allowEmptyValue() default false;
9298

9399
/**

api/src/main/java/org/eclipse/microprofile/openapi/models/headers/Header.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,27 @@ default Header deprecated(Boolean deprecated) {
139139
* Returns the allowEmptyValue property from a Header instance.
140140
*
141141
* @return the ability to pass empty-valued parameters
142+
*
143+
* @deprecated The OpenAPI specification states that {@code allowEmptyValue} is only valid for {@code query}
144+
* parameters. As the {@code Header} model is a specialized {@code Parameter}, this attribute is not
145+
* valid and should not be used. Removal of this property is planned for the next major release of
146+
* MicroProfile OpenAPI.
142147
**/
148+
@Deprecated(since = "4.2", forRemoval = true)
143149
Boolean getAllowEmptyValue();
144150

145151
/**
146152
* Sets this Header's allowEmptyValue property to the given value.
147153
*
148154
* @param allowEmptyValue
149155
* specify the ability to pass empty-valued parameters
156+
*
157+
* @deprecated The OpenAPI specification states that {@code allowEmptyValue} is only valid for {@code query}
158+
* parameters. As the {@code Header} model is a specialized {@code Parameter}, this attribute is not
159+
* valid and should not be used. Removal of this property is planned for the next major release of
160+
* MicroProfile OpenAPI.
150161
*/
162+
@Deprecated(since = "4.2", forRemoval = true)
151163
void setAllowEmptyValue(Boolean allowEmptyValue);
152164

153165
/**
@@ -156,7 +168,13 @@ default Header deprecated(Boolean deprecated) {
156168
* @param allowEmptyValue
157169
* specify the ability to pass empty-valued parameters
158170
* @return the current Header instance
171+
*
172+
* @deprecated The OpenAPI specification states that {@code allowEmptyValue} is only valid for {@code query}
173+
* parameters. As the {@code Header} model is a specialized {@code Parameter}, this attribute is not
174+
* valid and should not be used. Removal of this property is planned for the next major release of
175+
* MicroProfile OpenAPI.
159176
*/
177+
@Deprecated(since = "4.2", forRemoval = true)
160178
default Header allowEmptyValue(Boolean allowEmptyValue) {
161179
setAllowEmptyValue(allowEmptyValue);
162180
return this;

0 commit comments

Comments
 (0)