You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #2170 but for request headers instead of request parameters. Tested with 2.0.5-SNAPSHOT and bug still remains.
Describe the bug
We've got some large projects that we are gradually converting to Kotlin. For those projects we have a mix of Java and Kotlin rest controllers.
Under 2.0.2 in the Java controllers the required parameter of @RequestHeader was honoured. Under 2.0.3 / 2.0.4 it appears that this parameter is completely ignored. Furthermore adding in a @Parameter(required = false) annotation has no effect either.
So
Expected behavior
We weren't expecting the upgrade of spring boot / spring docs to change the OpenAPI documentation for of all our Java controllers. The fix appears to be either to convert all our controllers to Kotlin or setting
The latter change then means that we can't take advantage of the improvement in #2006 in our Kotlin controllers.
It also seems odd that the upgrade should change the behaviour in this way, perhaps the code should take into account whether it is a Java controller and if so then not to look at the nullability of the parameter to determine if it is required.
The text was updated successfully, but these errors were encountered:
Similar to #2170 but for request headers instead of request parameters. Tested with 2.0.5-SNAPSHOT and bug still remains.
Describe the bug
We've got some large projects that we are gradually converting to Kotlin. For those projects we have a mix of Java and Kotlin rest controllers.
Under 2.0.2 in the Java controllers the
required
parameter of@RequestHeader
was honoured. Under 2.0.3 / 2.0.4 it appears that this parameter is completely ignored. Furthermore adding in a@Parameter(required = false)
annotation has no effect either.So
always generates a required parameter:
To Reproduce
Actual is
Expected is
Sample controller is
Sample project demonstrating the issue (including test case) can be found at https://github.com/petergphillips/springdoc-optional-parameters.
Expected behavior
We weren't expecting the upgrade of spring boot / spring docs to change the OpenAPI documentation for of all our Java controllers. The fix appears to be either to convert all our controllers to Kotlin or setting
The latter change then means that we can't take advantage of the improvement in #2006 in our Kotlin controllers.
It also seems odd that the upgrade should change the behaviour in this way, perhaps the code should take into account whether it is a Java controller and if so then not to look at the nullability of the parameter to determine if it is required.
The text was updated successfully, but these errors were encountered: