2

Can you import a component that is defined in an other OpenAPI file?
Suppose I have two openAPI files: openAPI.yaml and otherOpenAPI.yaml. In openAPI.yml I want to use the myItem component that is defined in otherOpenAPI.yaml

Can I do something in the likes of: $ref: './otherOpenAPI.yaml/components/myItem ?

xtra
  • 1,957
  • 4
  • 22
  • 40

1 Answers1

4

You can use:

$ref: './otherOpenApi.yaml#/components/MyItem'

Reza Ghorbani
  • 2,396
  • 2
  • 28
  • 33
Fabian
  • 56
  • 2