noirbizarre / flask-restplus

Fully featured framework for fast, easy and documented API development with Flask
http://flask-restplus.readthedocs.org
Other
2.74k stars 506 forks source link

Could anyone help me with Flask-Swagger #774

Open chainsaw2100 opened 4 years ago

chainsaw2100 commented 4 years ago

Hello, everyone, I am not sure that it is a right place to post it, but I came from https://flask-restplus.readthedocs.io/en/stable/swagger.html link

I posted this already https://github.com/swagger-api/swagger-ui/issues/5794

Let me be more clear: 1 I try to fill with info and push button: 2

And nothing happens, only JS console error. I tried to debug it, but have not got anything.

What I want to get is:

class IDMovies(Resource):
    @swagger.operation(
        notes='Get info about a movie by id',
        nickname="getmovie",
        parameters=[
            {
                "name": "movie_id",
                "description": "ID of a movie to return",
                "required":True,
                "allowMultiple": False,
                "dataType":"string",
            }],
        responseMessages=[
            {
                "status": 200,
                "error": False
            },
            {
                "error_msg": "Not found movie",
                "status": 404,
                "error": True
            }
        ])
    def get(self, movie_id):
        movie = Movies.query.filter_by(imdbid=movie_id).first()
        if movie:
            movie = '{' + movie.__repr__() + '}'
            movie = json.loads(movie)
            return {'movie': movie, 'status': 200, 'error': False}
        else:
            return {'movie': "Not found movie", 'status': 404, 'error': True}
j5awry commented 4 years ago

NOTE: flask-restplus development has stopped. Support from previous maintainers will only occur on the new project. An official for by previous maintainers is available at https://github.com/python-restx/flask-restx and on pypi