question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Propagate `unknown` value through nested schemas?

See original GitHub issue

I’m wondering if the unknown value set on parent schema should propagate down through all nested schemas.

We raise by default, and to change that, one needs to let all his schemas specify another behaviour (~this is broken but will be fixed when #963 is merged~). This can be done with a custom schema to use as a base for all schemas, so it is feasible, and raise is a sensible default IMHO, but wouldn’t it make sense to let the parent schema unknown setting propagate?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zarakencommented, Aug 22, 2019

For now, our stance is that class Meta options should not be automatically propagated to nested fields. Users should use an base schema class in order to share default options across classes.

I do agree that class Meta options should not be automatically propagated.

However, what about when overriding unknown in the load method which should according to documentation override the value set at instantiation or in Meta. For this use case it would make sense to (conditionally) allow propagation to nested fields or ?

1reaction
charlaxcommented, Aug 26, 2019

At the very least, this behavior should be documented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Type Definition RFC 8927 - IETF Datatracker
The term "instance", when it appears in this document, refers to a JSON value being validated against a JTD schema. This value can...
Read more >
RFC 7643: System for Cross-domain Identity Management
RFC 7643 SCIM Core Schema September 2015 2.5. Unassigned and Null Values Unassigned attributes, the null value, or an empty array (in the...
Read more >
API Reference — marshmallow 3.19.0 documentation
Raised when validation fails on a field or schema. ... Propagates down to Nested fields as well. ... loads (json_data, *[, many, partial,...
Read more >
W3C XML Schema Definition Language (XSD) 1.1 Part 1
This specification depends on XML Schema Definition Language 1.1 Part ... will be unknown (and its [validity] property will have the value ......
Read more >
OData Common Schema Definition Language (CSDL) XML ...
The scope of a CSDL document is the document itself and all schemas included from directly referenced documents. All entity types, complex types...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found