API Specification in Multiple Files

With !include, it is possible to build your API specification in multiple files.

For example, these two files

# scanapi.yaml
endpoints:
  - name: scanapi-demo
    path: ${BASE_URL}
    requests: !include include.yaml
# include.yaml
- name: health
  path: /health/

would generate:

endpoints:
  - name: scanapi-demo
    path: ${BASE_URL}
    requests:
      - name: health
        path: /health/

The same works for JSON specifications:

// scanapi.json
{
  "endpoints": [
    {
      "name": "scanapi-demo",
      "path": "${BASE_URL}",
      "requests": !include include.json
    }
  ]
}
// include.json
[
  {
    "name": "health",
    "path": "/health/"
  }
]

would generate:

{
  "endpoints": [
    {
      "name": "scanapi-demo",
      "path": "${BASE_URL}",
      "requests": [
        {
          "name": "health",
          "path": "/health/"
        }
      ]
    }
  ]
}