jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

Swagger creates every http method for each urls of resource #231

Open gupta-shrinath opened 2 years ago

gupta-shrinath commented 2 years ago

I have a resource 'Students' which should have a

App.py api.add_resource(Students,api_version + '/student/<string:email>','/student/<string:id>')

Students Resource

class Students(MethodResource,Resource):

    @doc(description='Get student information',tags=['Student'])
    @marshal_with(StudentResponseSchema,code='200',description='Returns active student json') 
    def get(self,email,id=None):
        ..

    @doc(description='Update student nick name and avatar url provided in request body',tags=['Student']) 
    @use_kwargs(UpdateStudentClassAvatarRequestSchema,location=('json'))
    @marshal_with(ResponseSchema,code='200')
    def patch(self,id,avatar_url,nick_name,email=None):
        ..

My issue is Swagger is displaying both get and patch method for every url Screenshot from 2022-03-12 08-48-52 Please ignore PATCH /v1/student/last_login/{id}