marshmallow-code / marshmallow-code/marshmallow

Include a nested relation to one schema, without modifying the rest of the functions that use it

Open
#2,069 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
738
Avg merge
1d 23h
Merged PRs (30d)
7

Description

Basically I would like to add a new nested relation to an schema, that I already use in other services, without this implying a change to the rest of the functionalities that use it for serialization. Since I work with sqlalchemy, if I include the new relation, new unwanted statements appears everywhere, since the ORM tries to fill it. I would need something like adding the relation, and specifying that be only included if I specify it. I seen this kind of problem resolved in other libraries using groups annotations, so in this case, the relation is added, annotated with a new group, and them call serialize using the existing groups plus the new one.

Note: Create a new schema is not a good solution since the affected schema is deep in the relation, so I would have to create all it's fathers too.

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

The issue names no files, tests, or entry points, so begin by locating schema serialization and nested-relation handling in the repository. Define how an optional group or equivalent would be declared and selected, then add coverage showing the relation is excluded by existing serialization and included when the new option is requested.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.