fix: use data_key from field if available to set property name#100
fix: use data_key from field if available to set property name#100jgroth wants to merge 3 commits intofuhrysteve:masterfrom
Conversation
Marshmallow already has a way to customize the name of fields when serializing through the data_key property. The JSONSchema should use the same property when serializing the schema to json instead of inventing its own thing.
c7ed380 to
160c85a
Compare
|
Ping @fuhrysteve |
|
I’m only finding this PR now. I did more or less the same thing in #139 (comment) |
|
thanks @martijnthe and @jgroth ! Apologies for not having seen this before now. It looks like this changeset prefers data_key over metadata. Do either of you have a sense for which one follows the standard better? Seems like data_key should take precedence, however I'm not sure off the top of my head. |
|
I removed the use if metadata in this PR since Marshmallow already had the the |
#88 introduced the ability to customize the name of the fields when serializing, which is great! However, Marshmallow already has a way to customize the name of fields when serializing through the
data_keyproperty. The JSONSchema should use the same property when serializing the schema to json instead of inventing its own thing.