Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !633

[Java] add useNullForUnknownEnumValue option

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/jmini/issue625_add_useNullForUnknownEnumValue_option into master Jul 24, 2018
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 282

Created by: jmini

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.2.x, 4.0.x. Default: master.
  • Java Technical Committee: @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)

cc: @TehBakker, @slarti-b, @wing328, @cbornet

Description of the PR

Fixes #625 (closed)

This PR introduce a new option useNullForUnknownEnumValue.

  • When false the generated code throws an exception when the value is unknown (not present in the enum)
  • When true (3.1.x and 3.0.x behavior): unknown values are mapped to null

Migration guide is updated with this PR.

2 Java samples are still using the old behavior:

  • bin/java-petstore-jersey1.sh
  • bin/java-petstore-jersey2.sh
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jmini/issue625_add_useNullForUnknownEnumValue_option