Skip to content

No operations defined in spec using $ref for paths #375

@MathieuRA

Description

@MathieuRA

It looks like that file users.json is not resolved..
Archi:

  • index.js
  • swagger.json
  • users.json
// swagger.json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Mon API",
    "version": "1.0.0"
  },
  "paths": {
      "/users": {
          "$ref": "users.json"
      }
  }
}
// users.json

{
  "get": {
    "tags": ["pet"],
    "summary": "Finds Pets by status",
    "description": "Multiple status values can be provided with comma separated strings",
    "operationId": "findPetsByStatus",
    "parameters": [
      {
        "name": "status",
        "in": "query",
        "description": "Status values that need to be considered for filter",
        "required": false,
        "explode": true,
        "schema": {
          "type": "string",
          "default": "available",
          "enum": ["available", "pending", "sold"]
        }
      }
    ],
    "responses": {
      "200": {
        "description": "successful operation",
        "content": {
          "application/xml": {
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pet"
              }
            }
          },
          "application/json": {
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pet"
              }
            }
          }
        }
      },
      "400": {
        "description": "Invalid status value"
      }
    },
    "security": [
      {
        "petstore_auth": ["write:pets", "read:pets"]
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions