How to use the flask-api.app.ApiDocs function in Flask-API

To help you get started, we’ve selected a few Flask-API examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neo4j-examples / neo4j-movies-template / flask-api / app.py View on Github external
'description': 'invalid / missing authentication'
            }
        }
    })
    @login_required
    def delete(self, id):
        db = get_db()
        db.run(
            '''
            MATCH (u:User {id: {user_id}})-[r:RATED]->(m:Movie {id: {movie_id}}) DELETE r
            ''', {'movie_id': id, 'user_id': g.user['id']}
        )
        return {}, 204


api.add_resource(ApiDocs, '/docs', '/docs/')
api.add_resource(GenreList, '/api/v0/genres')
api.add_resource(Movie, '/api/v0/movies/')
api.add_resource(RateMovie, '/api/v0/movies//rate')
api.add_resource(MovieList, '/api/v0/movies')
api.add_resource(MovieListByGenre, '/api/v0/movies/genre//')
api.add_resource(MovieListByDateRange, '/api/v0/movies/daterange//')
api.add_resource(MovieListByPersonActedIn, '/api/v0/movies/acted_in_by/')
api.add_resource(MovieListByWrittenBy, '/api/v0/movies/written_by/')
api.add_resource(MovieListByDirectedBy, '/api/v0/movies/directed_by/')
api.add_resource(MovieListRatedByMe, '/api/v0/movies/rated')
api.add_resource(MovieListRecommended, '/api/v0/movies/recommended')
api.add_resource(Person, '/api/v0/people/')
api.add_resource(PersonList, '/api/v0/people')
api.add_resource(PersonBacon, '/api/v0/people/bacon')
api.add_resource(Register, '/api/v0/register')
api.add_resource(Login, '/api/v0/login')