Skip to content

Allow configuration of Kotlin render style#33

Closed
chiroptical wants to merge 4 commits intomasterfrom
barry/tagged-object-encoding
Closed

Allow configuration of Kotlin render style#33
chiroptical wants to merge 4 commits intomasterfrom
barry/tagged-object-encoding

Conversation

@chiroptical
Copy link
Copy Markdown
Collaborator

@chiroptical chiroptical commented Nov 9, 2021

The Kotlin rendering style we use here doesn't exist in Aeson (https://hackage.haskell.org/package/aeson-2.0.1.0/docs/Data-Aeson-TH.html#t:SumEncoding). There is a PR for this haskell/aeson#828.

We should add another rendering style to more closely match Aeson's TaggedObject style.

  • Add failing golden tests for TaggedObject style
  • Get test passing for Sum in SOP
  • Get test passing for Product in SOP
  • Add more golden tests to ensure nothing else is broken

Notes:

  • This implementation is not ideal. It should be configurable per type but going to continue here to get a clear implementation
  • The tests are incredibly unwieldy right now. It would be nice to have some TH that generates the golden tests with names that match the golden files

@chiroptical chiroptical deleted the barry/tagged-object-encoding branch November 15, 2021 19:17
@chiroptical chiroptical restored the barry/tagged-object-encoding branch November 16, 2021 15:30
@chiroptical chiroptical deleted the barry/tagged-object-encoding branch November 16, 2021 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant