Skip to content

XML: No way to have an object with both attribute and element value #4403

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

Open
SimSama opened this issue May 13, 2023 · 1 comment
Open

XML: No way to have an object with both attribute and element value #4403

SimSama opened this issue May 13, 2023 · 1 comment

Comments

@SimSama
Copy link

SimSama commented May 13, 2023

XML: No way to have an object with both attribute and element value
e.g.
Some text

This is a revival of this issue from OpenAPI years ago:
OAI/OpenAPI-Specification#630

I can define a object that has attributes, and some that have element values but not both.
Simple solution would be:

AttributeObject:
  type: object
  properties:
    name:
      type: string
      example: 'eventName'
      xml:
        attribute: true
    data:
      type: string
      example: 'myvalue'
      xml:
        elementValue: true
  xml:
    name: 'attribute'

Something like this should produce:
myvalue

@RonakPrajapatiPanamax
Copy link

If I have a REST API with a request body that has XML content instead of JSON, can Swagger automatically generate Swagger documentation for such an API? By this, I mean, just like for JSON REST APIs, this occurs in Spring Boot Java. Does the same also happen with XML?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants