Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could anyone help me with Flask-Swagger #774

Open
chainsaw2100 opened this issue Jan 22, 2020 · 1 comment
Open

Could anyone help me with Flask-Swagger #774

chainsaw2100 opened this issue Jan 22, 2020 · 1 comment
Labels

Comments

@chainsaw2100
Copy link

chainsaw2100 commented Jan 22, 2020

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}

@j5awry
Copy link
Collaborator

j5awry commented Feb 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants