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
  • Issues
  • #6646
Closed
Open
Issue created Jun 12, 2020 by Administrator@rootContributor3 of 6 checklist items completed3/6 checklist items

[Java][jersey2] The jersey2 library does not support additional undeclared properties

Created by: sebastien-rosset

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The jersey2 library fails deserialization when the input data contains additional (undeclared) properties. For example, suppose the input data is the following JSON document:

{
      "Name": "Bob",
      "CreateTime": "2020-04-13T21:57:56.552Z",
      "UserUniqueIdentifier": "2aff0200-3d2e-4ba3-823d-c9ea8877556d"
}

The schema explicitly declares Name and CreateTime but not UserUniqueIdentifier:

When the jersey2 library attempts to deserialize the payload, an error occurs:

INFO: Input data does not match schema 'XYZ'
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "UserUniqueIdentifier" (class XYZ),
not marked as ignorable (31 known properties: ""CreateTime", "Name", ...])
 at [Source: UNKNOWN; line: -1, column: -1]
(through reference chain: XYZ["Results"]->java.util.ArrayList[0]->XYZ["UserUniqueIdentifier"])
openapi-generator version

master June 12th

OpenAPI declaration file content or url
User:
  type: object
  properties:
    Name:
      type: string
    CreateTime:
      type: string
  additionalProperties: true
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking