jmcarp / jmcarp/flask-apispec

flask-apispec==0.8.7 : how to use apispec doctrings to populate the swagger documentation info?

Open
#182 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
652
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Hello,
i have a very simple endpoint like this:

```
app = Flask(__name__)
docs = flask_apispec.FlaskApiSpec(app)

@app.route('/')
def main():
"""top-level stuff
---
get:
summary: whatever
description: double whatever
parameters: None
responses:
200:
description: all good here
"""
return "all good here\n"

docs.register(howdy)
```

but the swagger is never generated from the docstring. i can _at least_ produce the description via `@flask_apispec.annotations.doc(description='top-level stuff')` but i couldnt find a way to populate the other information in the swagger interface with this decorator.

how do i use the apispec docstring with flask_apispec?

i have `apispec==3.3.0` installed in this venv, in case it matters

thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the example using FlaskApiSpec(app), the endpoint docstring, docs.register, and apispec==3.3.0; begin by checking how FlaskApiSpec processes docstrings versus annotations. Confirm whether the requested Swagger fields are supported, and document the working usage or the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.