fuhrysteve / marshmallow-jsonschema

JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
MIT License
209 stars 72 forks source link

Skip title if either fields are None #93

Open yeralin opened 5 years ago

yeralin commented 5 years ago

Addresses #87

Because of lack of support of doubly (or more) nested schemas, some titles get rendered as null which breaks JSON schema validation. This PR simply skips title if field.attribute or field.name are None

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling eab1de0a0ae5676b3a3f02598d546b42e60b4db2 on yeralin:fix-doubly-nested-null-titles into 47418df6fe7d618c54d24433e471435875459f2c on fuhrysteve:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.6%) to 98.44% when pulling 4f563ad2f377acad875b10ac687510cffc2a6cc3 on yeralin:fix-doubly-nested-null-titles into 307a911c38a4d827d06794a04f29794fee788c4a on fuhrysteve:master.

yeralin commented 5 years ago

The build is failing because tox is installing marshmallow-jsonschema==0.7.0 that does not contain recently merged change from #86

After a new version is released, the build is supposed to pass.

yeralin commented 5 years ago

Hmmm even after a new release, the build is still failing... I also added an extra test case, but the coveralls are still -1.8% :(

atmo commented 4 years ago

Hi @yeralin! The build is failing because of a subtle bug that was introduced in previous PRs. See #102 for details. I'm afraid that we'll have to wait until that PR fixes master, and only then you can rebase your branch and have clean builds.

I think that your solution works just fine: it maintains backward compatibility and in my opinion we will need to drop Python 2 support and Marshmallow 2 support very soon anyway.