fuhrysteve / marshmallow-jsonschema

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

Provide option to use data keys as property name and title #65

Open smith-m opened 6 years ago

smith-m commented 6 years ago

provide option to use data_keys or load_from and dump_to as title

Use as JSONSchema(prefer_data_key=True) to enable

smith-m commented 6 years ago

Relates to https://github.com/fuhrysteve/marshmallow-jsonschema/issues/64

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.6%) to 98.675% when pulling bf853faf3f1089db63f4767c307a6a8784020d47 on smith-m:feature/useDataKeys into 3e0891a79d586c49deb75188d9ee1728597d093b on fuhrysteve:master.

smith-m commented 6 years ago

Code coverage reduced because data_keys vs load_from / dump_to behavior differs between marshmallow 2 v 3. One statement has been added to differentiate between marshmallow version for this purpose. Current testing does not seem to work for marshmallow v3. Is there a recommended way to test a library across multiple versions of a dependency?

smith-m commented 6 years ago

Also, I will add example of this functionality to readme if this will be merged

fuhrysteve commented 6 years ago

Looking good! I'll spend some time looking it over later this week!

fuhrysteve commented 6 years ago

@smith-m If you can look over and merge this in:

https://github.com/smith-m/marshmallow-jsonschema/pull/1

That should fix the tests I think! It does for me locally, anyways