TypeError: "O is undefined" with url parameters
- Dominant language
- Python
- Stars
- 652
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
I'm using flask-apispec with flask-restful
Example of view
```
from flask_restful import Resource, Api
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from flask_apispec.extension import FlaskApiSpec
api = Api(app)
app.config.update({
'APISPEC_SPEC': APISpec(
authorizations=authorizations,
title='pets',
version='v1',
plugins=[MarshmallowPlugin()],
openapi_version="3.0.3",
),
'APISPEC_SWAGGER_URL': '/swagger/',
})
class ListView(MethodResource):
def get(self, type_id, list_id):
#some code
api.add_resource(ListView, '/api/types//lists//')
docs = FlaskApiSpec(app)
docs.register(ListView)
```
and when I open Swagger UI i get


Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Flask-RESTful example in the issue and reproduce the Swagger UI failure for the route containing type_id and list_id. Trace how flask-apispec registers ListView and generates the OpenAPI path parameters; done means the documented route loads in Swagger UI without the “O is undefined” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100