swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

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

Open SimSama opened this issue 2 years ago • 1 comments

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: https://github.com/OAI/OpenAPI-Specification/issues/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

SimSama avatar May 13 '23 00:05 SimSama

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?

RonakPrajapatiPanamax avatar Apr 26 '24 07:04 RonakPrajapatiPanamax