Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][JAVA][Jackson] Incorrect annotations #5989

Closed
5 of 6 tasks
jzrebiec opened this issue Apr 20, 2020 · 1 comment
Closed
5 of 6 tasks

[BUG][JAVA][Jackson] Incorrect annotations #5989

jzrebiec opened this issue Apr 20, 2020 · 1 comment

Comments

@jzrebiec
Copy link

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

Xml annotations have wrong values if $ref is used

openapi-generator version

4.3.0

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: API
  version: 1.0.0

paths:
  /:
    post:
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/Request'
      responses:
        '200':
          description: OK

components:
  schemas:
    Request:
      type: object
      properties:
        simpleAttribute:
          type: string
          xml:
            attribute: true
            name: ATTR
        refAttribute:
          $ref: '#/components/schemas/RefAttribute'
        simpleNode:
          type: object
          properties:
            prop1:
              type: string
            prop2:
              type: string
          xml:
            name: NODE
        refNode:
          $ref: '#/components/schemas/RefNode'
        simpleArray:
          type: array
          items:
            type: string
            xml:
              name: ARR_ITEM
        simpleWrappedArray:
          type: array
          items:
            type: string
            xml:
              name: ARR_ITEM
          xml:
            wrapped: true
            name: WRAPPED_ARRAY
        nodeArray:
          type: array
          items:
            $ref: '#/components/schemas/RefNode'
        wrappedNodeArray:
          type: array
          items:
            $ref: '#/components/schemas/RefNode'
          xml:
            wrapped: true
            name: WRAPPED_NODE_ARRAY
      xml:
        name: Request

    RefAttribute:
      type: string
      enum: [A, B, C]
      xml:
        name: REF_ATTR
        attribute: true

    RefNode:
      type: object
      properties:
        prop1:
          type: string
        prop2:
          type: string
      xml:
        name: REF_NODE
Command line used for generation
generate -g java --library resttemplate -o C:\openapi-generator-tests -i C:\openapi-generator-tests\Schema.yaml --additional-properties=withXml=true,serializationLibrary=jackson,dateLibrary=java8-localdatetime --model-package=com.my.project

Steps to reproduce

Actual

https://gist.github.com/jzrebiec/1eb12e8511403e11d459d6ebd8cbfc5d

Expected

https://gist.github.com/jzrebiec/bda6719eae8222859d11f13197a757e2

Related issues/PRs

#3223 #2417 #5078 #5371

Suggest a fix

#5371

Philzen added a commit to Philzen/openapi-generator that referenced this issue May 22, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue May 22, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue May 22, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue May 23, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue May 24, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
@Philzen
Copy link
Contributor

Philzen commented Jun 6, 2024

This may have been already solved via #15115, can you confirm?

Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 6, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 13, 2024
Philzen added a commit to Philzen/openapi-generator that referenced this issue Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants