Forum Discussion

slogic's avatar
slogic
Occasional Contributor
4 years ago

Can we combine $ref and xml meta info altogether?

Is it legal to declare the following block:

 

 

openapi: 3.0.1
info:
  version: 1.0.0
  title: title
paths: {}
components:
  schemas:
    SomeType:
      type: object
      properties:
        MyAttribute:
          $ref: "#/components/schemas/MyAttributeType"
          xml:
            attribute: true
            name: MyAttributeSpecialName
    MyAttributeType:
      type: object

 

1 Reply

  • slogic's avatar
    slogic
    Occasional Contributor

    Just input example into online editor. It tells me xml meta info is ignored and i need to put it into allOf wrapper or built into schema.