Marwes / schemafy

Crate for generating rust types from a json schema
MIT License
242 stars 51 forks source link

Don't accumulate types of previous fields in type names #49

Closed bgilbert closed 3 years ago

bgilbert commented 3 years ago

After finishing a type expansion, reset self.current_type so that the details of the field aren't prepended to type names of future fields.

The test schema currently produces these types:

Root
RootItemA
RootItemAC
RootItemACK
RootItemACKItemM
RootItemACKItemMT
RootItemACKItemMTItemV

With this change, it produces these types:

Root
RootItemA
RootItemAC
RootK
RootKM
RootT
RootTV