marshmallow-code / marshmallow-code/flask-smorest

Allow common headers on Blueprint/MethodView

Open
#311 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
717
Forks
77
Avg merge
7h 49m
Merged PRs (30d)
3

Description

Hi,

I'd like to propose an option to define header schemas on a Blueprint or at least MethodView level.

An example use case would be a context/correlation id - optional headers in the request, whose values can then be used for easier tracking/debugging purposes in logs.

Currently, if I'm not mistaken, to auto-document these, one has to decorate every single endpoint of the API, which is a bit cumbersome and error-prone.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Blueprint and MethodView endpoint schemas are collected and how header schemas are auto-documented. Determine where a schema defined at Blueprint or MethodView level could be applied, then verify that one definition covers its endpoints without decorating each endpoint individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, openapi, python
Domain
api, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.