Skip to content
Snippets Groups Projects
Commit b3e28505 authored by Anthony's avatar Anthony
Browse files

Some example of swagger

parent ef2e7f2c
No related branches found
No related tags found
1 merge request!2Draft:Generic api v1
...@@ -13,15 +13,18 @@ class MRResponseSchema(Schema): ...@@ -13,15 +13,18 @@ class MRResponseSchema(Schema):
class MRRequestSchema(Schema): class MRRequestSchema(Schema):
api_type = fields.String(required=True, description="API type of awesome API") class Meta:
fields = ('name', 'description') # TODO just an example
class MiradorResource(MethodResource,Resource): class MiradorResource(MethodResource,Resource):
@doc(description='My First GET Awesome API.', tags=['Mirador resource']) @doc(description='Mirador resource i e, manifest and collection of IIIF resource', tags=['Mirador resource'])
@marshal_with(MRResponseSchema) # marshalling @marshal_with(MRResponseSchema) # marshalling
def get(self, id=None): def get(self, id=None):
return {'method': 'get', 'id': id} return {'method': 'get', 'id': id}
@doc(description='Create Mirador resource i e, manifest and collection of IIIF resource', tags=['Mirador resource'])
@use_kwargs(MRRequestSchema, location=('json'))
def post(self): def post(self):
return {'method': 'post'} return {'method': 'post'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment