Keep Model Definitions in separate File

Hey, Can you separate the model definitions into their own descrete files?

According to the Spec, it seems you should be able to, but should I been using the JSON format instead of YAML (As YAML has mandatory elements):

https://swagger.io/specification/#referenceObject

Example I have the following definition which I'm referencing in multiple specs and it is always the same:

definitions:
  Product:
    title: Our Product
    type: object
    properties:
      EditionID:
        type: number
      CoverTitle:
        type: string
      ISBN13:
        type: string
      SubTitle:
        type: string
      CoverAuthors:
        type: string
      WorkReference:
        type: string
      Binding:
        type: string
      Division:
        type: string
      Format:
        type: string
      SortTitle:
        type: string
      WorkID:
        type: string
      Imprint:
        type: string
      Pubdate:
        type: string
      Description:
        type: string
Solved Solved
0 2 235
1 ACCEPTED SOLUTION

rmishra
Participant V

If you are using Open API Spec V3, you can specify it in either format.

However, the Smart Docs Module in Developer Portal does not support it yet.

https://community.apigee.com/questions/43498/does-apigee-developer-portal-smartdocs-support-ope.html

View solution in original post

2 REPLIES 2

rmishra
Participant V

If you are using Open API Spec V3, you can specify it in either format.

However, the Smart Docs Module in Developer Portal does not support it yet.

https://community.apigee.com/questions/43498/does-apigee-developer-portal-smartdocs-support-ope.html

Damn. All good though.
Thanks for replying.