swagger-api / swagger-api/swagger-codegen

OpenAPI 3.0 does not create XML subelement name within a wrapping element

Open
#9,795 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm having trouble producing a model based on a simple definition for XML and I'm not sure what I'm going wrong. Here's my command line:
java -jar swagger-codegen-cli.jar generate -i openapi.json -l java -c java-config.json -o v3Client

Swagger-codegen version 3.0.13

I'm using swagger-codegen-cli.jar version 3.0.13. I'll zip up the openapi.json, java-config.json and the ArrayTests.java class into the attached file so you can see what I'm doing. The ArrayTests model class appears to be missing the "test" element and I don't know why. Would someone please tell me what I'm doing wrong? Does the xml wrapper element and sub-element naming work for Arrays?
test.zip

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached test.zip, especially openapi.json, java-config.json, and the generated ArrayTests.java, then reproduce with the stated swagger-codegen-cli.jar command. Compare the XML wrapper and subelement declarations with the generated model; done means ArrayTests.java contains the expected "test" element for the OpenAPI 3.0 array definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.