jmcarp / jmcarp/flask-apispec

Is marshall_with unnecessary boilerplate?

Open
#174 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
652
Forks
151
PR merge metrics
No merged PRs in 30d

Description

In principal, it seems like `marshall_with` is unnecessary boilerplate.

If we could attach a `marshmallow.Schema` to classes (e.g. database models) returned by Flask routes, `flask-apispec` should be able to hook into Flask's post-request machinery to infer the relevant schema and serialize them accordingly.

I'd be willing to try to implement this it's a good idea and if someone could give me some pointers on how to do it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the existing `marshall_with` behavior and Flask's post-request machinery, then examine how `marshmallow.Schema` could be attached to classes returned by Flask routes. Done would mean a reviewed design and implementation that infers the relevant schema and serializes those responses without requiring `marshall_with`.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.