How to create a schema that has no
See original GitHub issueGiven the following schema:
class CalendarSchema(Schema):
days_of_month = fields.List(fields.Integer(), default=[], validate=validate.ContainsOnly(range(1, 31 + 1)))
The above schema works fine as long as the array passed contains the value between [1, 31]. However, if the array was an empty array ([]
), the validation fails. How can I tweak fields.List
such that it accepts an empty array?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
SQL CREATE/ALTER/DROP SCHEMA - w3resource
SQL CREATE/ALTER/DROP SCHEMA: A schema is a logical database object holder. ... If not mentioned the current user is set as the owner....
Read more >CREATE SCHEMA (Transact-SQL) - Microsoft Learn
CREATE SCHEMA can create a schema, the tables and views it contains, and GRANT, REVOKE, or DENY permissions on any securable in a...
Read more >CREATE SCHEMA statement - IBM
Identifies a schema called schema-name, whose owner is authorization-name. The schema-name must not identify a schema already described in the catalog (SQLSTATE ...
Read more >SQL Server CREATE SCHEMA Statement By Examples
In this syntax, First, specify the name of the schema that you want to create in the CREATE SCHEMA clause.
Read more >CREATE SCHEMA - Snowflake Documentation
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After giving this some thought, I think
ContainsOnly
should accept empty values as valid inputs. Validating against empty vs. non-empty is outside the responsibility ofContainsOnly
. If you need to validate that input is non-empty, useLength(min=1)
.Would be nice to have
ContainsOnly
accepting a param likeallow_empty
to make empty lists allowed