Skip to content

[BUG] Broken wrapped xml example #22274

@sruehl

Description

@sruehl

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
Description

With #21899 and #21913 we introduced a wrapped xml feature/fix regarding wrapped elements in golang.
However we did a small mistake with the spec. You don't define the name of the element beside wrapped, that is the name of the list. The element must be named with xml at the element by itself.

wrong:

        photoUrls:
          items:
            type: string
          type: array
          xml:
            name: photoUrl
            wrapped: true

right:

        photoUrls:
          items:
            type: string
            xml:
              name: photoUrl
          type: array
          xml:
            wrapped: true
openapi-generator version

head

OpenAPI declaration file content or url

spec in repo / can be found in #21913

Generation Details

check prs

Steps to reproduce

copy current file in swagger editor and validate wrong wrapping:

Image

this is the right wrapping used:

Image
Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions