Skip to content

Could anyone help me with Flask-Swagger #774

Open
@chainsaw2100

Description

@chainsaw2100

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 swagger-api/swagger-ui#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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions