1

I reference an external schema for a property but I want to add my own description.

myProp:
  allOf:   
    - $ref: "https://opensource.zalando.com/problem/schema.yaml#/Problem"
    - type: object

Swagger editor tells me

Could not resolve reference: Could not resolve pointer /Problem does not exist in document

It looks like it will only allow allOf, for locally defined objects. Is that correct?

More Than Five
  • 9,959
  • 21
  • 77
  • 127
  • Your definition is syntactically valid and works fine for me (i.e. no errors) in https://editor.swagger.io. That said, this particular example does not need `allOf`, you can write `myProp:` and the next line just `$ref: "https://opensource.zalando.com/problem/schema.yaml#/Problem"`. Do you use https://editor.swagger.io or a locally hosted editor? Can you post your complete OpenAPI YAML file? – Helen Sep 13 '19 at 16:31
  • @Helen Where do I put the description for myProp them? – More Than Five Sep 16 '19 at 08:51
  • Possible duplicate of [Swagger: Add description with ref](https://stackoverflow.com/questions/43003348/swagger-add-description-with-ref) – Helen Sep 27 '19 at 11:01

0 Answers0