OpenAPITools / OpenAPITools/openapi-generator
[BUG] XML attribute incompatible with JSON $ref
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When using reference to describe property, the xml meta information is lost in the parsing.
It is therefore impossible when using reference to define xml related information. This seems like a big limitation.
openapi-generator version
3.0.2
OpenAPI declaration file content or url
openapi: 3.0.2
paths: {}
components:
schemas:
XXX:
type: object
properties:
MyAttribute:
$ref: "#/components/schemas/MyAttributeType"
xml:
attribute: true
name: MyAttributeSpecialName
Suggest a fix
No idea as when using $ref it is supposed to replace the block content, therefore I don't know how this should be handled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied OpenAPI declaration and reproduce how the parser handles a property combining $ref with xml metadata. Trace the relevant parsing and generation path; done means the xml attribute and name remain available when the referenced schema is used, with regression coverage for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100