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
Springfox will correctly create two mappings for /foo and /foo/{bar} but define the bar parameter as required for both mappings. I think the problem lies in the OperationParameterReader which should detect that the parameter for bar should be ignored for the mapping of /foo.
I think that a solution could be as simple as adding a condition to the OperationParameterReader:shouldIgnore method that looks something similar to:
This way any parameter would be suppressed that is:
Representing a path variable
Is not required
Is not part of the mapped path.
The text was updated successfully, but these errors were encountered:
raphw
changed the title
ParameterRequiredReader does not process optional path parameters correctly
OperationParameterReader does not process optional path parameters correctly
Jan 31, 2018
When a Spring controller offers an optional parameter such as in:
Springfox will correctly create two mappings for
/foo
and/foo/{bar}
but define thebar
parameter as required for both mappings. I think the problem lies in theOperationParameterReader
which should detect that the parameter forbar
should be ignored for the mapping of/foo
.I think that a solution could be as simple as adding a condition to the
OperationParameterReader:shouldIgnore
method that looks something similar to:This way any parameter would be suppressed that is:
The text was updated successfully, but these errors were encountered: