Comments (7)
https://travis-ci.org/podhmo/swagger-marshmallow-codegen/jobs/580537371
from swagger-marshmallow-codegen.
class A(Schema):
nums = fields.List(fields.Integer(), validate=[ItemsRange(min=1, max=10), Unique()])
File "swagger_marshmallow_codegen/tests/dst/00items.py", line 12, in A
nums = fields.List(fields.Integer(), validate=[ItemsRange(min=1, max=10), Unique()])
File "$HOME/venvs/my/swagger-marshmallow-codegen/swagger_marshmallow_codegen/validate.py", line 67, in __init__
super().__init__(*args, **kwargs)
File "$HOME/venvs/my/lib/python3.7/site-packages/marshmallow/validate.py", line 216, in __init__
min_op=self.message_gte if self.min_inclusive else self.message_gt
KeyError: 'min'
from swagger-marshmallow-codegen.
min_inclusive and max_inclusive options are supported, officially?
And interface is changed?
from swagger-marshmallow-codegen.
hmm
marshmallow
- min_inclusive, max_inclusive
- default is True
openapi
- https://swagger.io/docs/specification/data-models/data-types/#Minimum%20and%20Maximum
- https://json-schema.org/understanding-json-schema/reference/numeric.html#range
x < exclusiveMaximum
x <= max
(default)
so,
- jsonschema's
minimum=10
asmin=10 and inclusive_min=True
- jsonschema's
exclusiveMinimum=10
asmin=10 and inclusive_min=False
from swagger-marshmallow-codegen.
AdditonalProperty support is also broken.
from swagger_marshmallow_codegen.schema import AdditionalPropertiesSchema
from marshmallow import fields
class S(AdditionalPropertiesSchema):
name = fields.String()
S().load({"name": "foo", "value": 10})
marshmallow.exceptions.ValidationError: {'value': ['Unknown field.']}
from swagger-marshmallow-codegen.
yeah, this hook is not worked.
since.
marshmallow-code/marshmallow@06aea4a
from swagger-marshmallow-codegen.
this is error. because using fields.Field()
from marshmallow import Schema, fields
class Product(Schema):
product_id = fields.String()
description = fields.String(description="Description of product.")
class ProductList(Schema):
products = fields.List(fields.Field(Product))
use fields.NestedField.
from swagger-marshmallow-codegen.
Related Issues (20)
- get version info from module HOT 1
- Question: Is it possible to set "emit_schema_even_primitive_type" from command line? HOT 9
- Dependency `dictknife` is broken HOT 3
- ItemsRange validator causes exception with flask-apispec doc.register
- 📝 careless schema definitions (memo) HOT 4
- nested field using lambda HOT 4
- using UnknownField, Include for additionalProperties HOT 1
- treating AdditionalProperties only schema as Dict field HOT 2
- handle additionalProperties correctly HOT 5
- use pytest
- use dict not OrderedDict
- customization example (x-default-now)
- use readme.md instead of readme.rst
- additionalProperties with ref is broken HOT 3
- nested additionalProperties is not supported yet HOT 2
- handling nullable and x-nullable correctly? HOT 2
- strict option
- rewriting the handle way of paths part HOT 1
- Does not support minItems on array (generate ItemsRange validator instead of Length) HOT 3
- Ability to use as a Python module HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-marshmallow-codegen.