OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

xml property and root schemas

Open MikeRalphson opened this issue 6 years ago • 8 comments

This is a question about the specification, and the intent of the following description in the Schema Object, relating to the xml property:

This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.

This has the effect of banning the construct

components:
  schemas:
    mySchema:
      type: object
      properties:
        a:
          type: string
      xml:
        name: xmlSchema

As a point-of-reference only, both swagger-ui and swagger-editor appear to honour this (useful) construct.

Is it possible to align the specification with real-world use for this case, and possibly move the restriction on xml properties on root schemas to those sub-properties (such as attribute and wrapped) where it seems to make sense?

MikeRalphson avatar Dec 13 '17 11:12 MikeRalphson