Total Complexity | 1 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from flask_restful import Resource |
||
2 | |||
3 | from app.context import context_property |
||
4 | from app.decorators.validation import validate_with_pydantic, PayloadLocation |
||
5 | from app.views.sample.schema import Post |
||
6 | |||
7 | |||
8 | class SampleAPI(Resource): |
||
9 | @validate_with_pydantic(PayloadLocation.JSON, Post) |
||
10 | def post(self): |
||
11 | payload = context_property.request_payload |
||
12 | |||
13 | return payload.dict(), 201 |
||
14 |