Flask-swagger takes docstrings like the following to create swagger specifications.
I would like to have a tool which automatically checks if the docstring has obvious errors. The errors could be formatting issues or missing parts (e.g. if there is a request.args['foobar']
in the function body, then foobar
must be in the parameters part). Does something like this exist?
Flask-swagger docstring
"""
Create a new user
---
tags:
- users
definitions:
- schema:
id: Group
properties:
name:
type: string
description: the group's name
parameters:
- in: body
name: body
schema:
id: User
required:
- email
- name
properties:
email:
type: string
description: email for user
name:
type: string
description: name for user
address:
description: address for user
schema:
id: Address
properties:
street:
type: string
state:
type: string
country:
type: string
postalcode:
type: string
groups:
type: array
description: list of groups
items:
$ref: "#/definitions/Group"
responses:
201:
description: User created
"""