Created by: upachler
I'd like to fix issue #3995 with this PR (see my comments there).
The fix creates an additional static method fromString()
as required by the JAX RS spec, so that compliant implementations can correctly parse enum arguments whoose wire string representation differs from the Java enum field name (e.g. MyEnum.FOO vs. "foo"). As it stands right now, a JAX RS implementation would expect "FOO" as a value passed as parameter, so parsing "foo" will fail.
I've coded this fix against v4.3.1, as I ran into other issues with 5.0.0 in my project and did use 4.3.1 there; however I assume this can be merged into both the 4.3.x and 5.0.x lines. I couldn't find a release branch for 4.3.x, so this PR is made against master
in the hope that it will also be patched into the 4.3.x line if accepted.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
script does not exist in 4.3.1 Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.