Flasgger/Swagger: Resolver Errror when using $ref

171 Views Asked by At

I'm using Flasgger 0.9.7b2 with OpenAPI 2.0. This is an excerpt I have in my yaml file:

responses:
  200:
    description: Successfully fetched models.
    schema:
      $ref: "model.yml#/definitions/Model"

In the same directory, I have my model.yml file:

definitions:
  Model:
    type: object
    properties: 
    ...

definitions is not nested.

However, after running my flask application, I encounter this error at the top of the Swagger page:

Errors
 
Resolver error at paths./model/.get.responses.200.schema.$ref
Could not resolve reference: undefined undefined

What could I do to resolve this issue?

I've tried following the OpenAPI documentation and it seems to I'm doing everything correct, but error persists. I've tried changing the contents into a Python dictionary, but it's still the same issue. I also tried following this: https://azimi.me/2015/07/16/split-swagger-into-smaller-files.html, but that didn't work either.

0

There are 0 best solutions below