Skip to content

There is no add_resource in Api #297

@paulzhn

Description

@paulzhn

Ask a question
In the minimal example of doc:

from flask_restx import Resource, Api

app = Flask(__name__)
api = Api(app)

@api.route('/hello')
class HelloWorld(Resource):
    def get(self):
        return {'hello': 'world'}

if __name__ == '__main__':
    app.run(debug=True)

it invoked the add_resource() by api directly; however, it seems like it only exists in Namespace. Is the doc wrong?

Additional context
flask-restx==0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions