flask_accepts icon indicating copy to clipboard operation
flask_accepts copied to clipboard

How to add documentation and validation for a field in the header of the request body

Open priyanshu20 opened this issue 4 years ago • 5 comments

Hey, so i want to implement token verification and i require to accept the authentication token as a header key value pair i want to validation and document it in the OpenApi specification using marshmallow and accepts

priyanshu20 avatar Mar 28 '20 16:03 priyanshu20

You can use the api.header decorator documented here

apryor6 avatar Mar 28 '20 16:03 apryor6

the documentation uses the requestparser for expected header, any way we can use marshmallow and the accepts library

priyanshu20 avatar Mar 28 '20 16:03 priyanshu20

Not currently, but I will mark this as a feature request as it would be useful.

apryor6 avatar Apr 01 '20 12:04 apryor6

@priyanshu20 AJ also addresses this in #45.

calvinwyoung avatar Apr 12 '20 19:04 calvinwyoung

thank you for pointing it out

priyanshu20 avatar Apr 13 '20 18:04 priyanshu20