Instagram / ig-json-parser

Fast JSON parser for java projects
https://instagram-engineering.com/fast-auto-generated-streaming-json-parsing-for-android-ab8e7be21033
MIT License
1.32k stars 124 forks source link

Filter token expansion for serializeCodeFormatter #54

Closed jingibus closed 6 years ago

jingibus commented 6 years ago

This PR prevents JsonType.serializeCodeFormatter from expanding collection- or field-specific tokens supported by JsonField.serializeCodeFormatter, and prevents JsonField.serializeCodeFormatter from expanding the generic ${subobject} token.

This is a big semantic change for code formatters. Previously, code formatters did not need to be opinionated about which tokens they would accept. Now, they do. So a simple String no longer works: an object is required to keep track of which tokens are valid. Therefore, all code formatter strings have been changed into CodeFormatter instances.

kangzhang commented 6 years ago

thanks for putting this up, looks great!