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.

Strict Schema Validation should be enabled by default

See original GitHub issue

To me, it goes against the zen of Python that validation fails silently when the strict parameter is not set to True. Why is it false by default? Shouldn’t it be True by default?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
maximkulkincommented, Nov 18, 2016

In our project we just use our own base class for all schemas:

class Schema(marshmallow.Schema):
    def __init__(self, strict=True, **kwargs):
        super(Schema, self).__init__(strict=strict, **kwargs)
6reactions
sloriacommented, Mar 9, 2017

After giving this some thought, I am leaning towards making schemas strict by default.

If anyone has objections, speak now or forever hold your peace. =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strict Schema Validation - Oracle Help Center
From version 21A, the feature will be enabled by default but can still be disabled if more time is needed to develop current...
Read more >
Strict mode - Ajv JSON schema validator
Ignored defaults​​ With useDefaults option Ajv modifies validated data by assigning defaults from the schema, but there are different limitations when the  ......
Read more >
Generic keywords — Understanding JSON Schema 2020-12 ...
The default keyword specifies a default value. This value is not used to fill in missing values during the validation process. Non-validation tools...
Read more >
Add strict mode for JSON Schema validation
For the validation of a JSON instance with a JSON Schema, you need to add in the JSON Schema the "additionalProperties": false construct...
Read more >
Schema Validation — MongoDB Manual
By default, when an insert or update operation would result in an invalid document, MongoDB rejects the operation and does not write the...
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