0

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.

Anthon
  • 69,918
  • 32
  • 186
  • 246
Y0oo0
  • 1
  • The officially recomended extension for files containing YAML documents has been `.yaml` since at least September 2006. The documentation at the link you provide also seems to be using `.yaml`. The [YML](https://fdik.org/yml/) format is XML based and if that is also supported, the content of `model.yml` might just get interpreted incorrectly. – Anthon Jun 30 '23 at 19:50
  • @Anthon unfortunately, even though I changed model.yml file to model.yaml, it still produces the same error. Still, thanks for the help! – Y0oo0 Jul 05 '23 at 18:13

0 Answers0