marshmallow-code / marshmallow-code/marshmallow

Allow specifying output field when using `unknown=INCLUDE`

Open
#853 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

From https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-393057138

> We could even go further and let the user set a default Field when using *INCLUDE*, but I'm not sure it is so useful, and it is never too late to add it in a later step.

(edited to make the argument name correct)

I suggested [here](https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-397430467) that a field could be passed to unknown, e.g. `unknown=fields.Str()`.

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 reading the linked discussion in issue 524 and the current handling of unknown=INCLUDE. Trace how a field such as fields.Str() would be applied to unknown output fields, then identify the relevant tests for unknown-field serialization. Done means the requested output-field behavior is specified, implemented, and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.