coding-kitties / flask-swagger-generator

A simple to use flask swagger generator working with the Flask web framework.
MIT License
6 stars 6 forks source link

Generated Swagger Yaml has incomplete RequestBody Reference #10

Closed Oracking closed 2 years ago

Oracking commented 2 years ago

The 'requestBody' field in the generated swagger yaml has a $ref that has an incomplete reference.

Currently, this is the yaml that is generated:

paths:
  '/some/route':
    post:
      requestBody:
         $ref: 'name_of_function_request_body'   # <-- Issue is here

But this is the valid swagger equivalent

paths:
  '/some/route':
    post:
      requestBody:
        $ref: '#/components/requestBodies/name_of_function_request_body'   # <-- Valid Reference

This causes swagger UI to break when fed this yaml

MDUYN commented 2 years ago

I will start a hotfix branch for this issue

Oracking commented 2 years ago

Picking up this issue

MDUYN commented 2 years ago

I will close this issue for now.