Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all Aeson options #10

Open
12 of 22 tasks
ollef opened this issue May 22, 2020 · 3 comments
Open
12 of 22 tasks

Support all Aeson options #10

ollef opened this issue May 22, 2020 · 3 comments

Comments

@ollef
Copy link
Collaborator

ollef commented May 22, 2020

The options that we take into account in the code are the following:

  • fieldLabelModifier
  • constructorTagModifier
  • allNullaryToStringTag
  • omitNothingFields
  • sumEncoding
    • TaggedObject
    • UntaggedValue
    • ObjectWithSingleField
    • TwoElemArray
  • unwrapUnaryRecords
  • tagSingleConstructors

But most of them, save for what's set in defaultOptions, are untested. So a big part of this issue is to add tests to haskell-to-elm-test for the different options, or find another way to test them, and fix any issues that come up.

Write tests for the following options:

  • fieldLabelModifier
  • constructorTagModifier
  • allNullaryToStringTag
  • omitNothingFields
  • sumEncoding
    • TaggedObject
    • UntaggedValue
    • ObjectWithSingleField
    • TwoElemArray
  • unwrapUnaryRecords
  • tagSingleConstructors
@bartavelle
Copy link

There is a very restricted Options type in the library. I think it should either be a superset of aeson's, or directly use aeson's.

@ollef
Copy link
Collaborator Author

ollef commented May 24, 2020

The Options type in this library is to configure what the Elm type should be like, so it doesn't really make sense that it should have all the options that Aeson has (but perhaps some others?). The JSON derivation functions take both a haskell-to-elm Options and an Aeson Options and they're both used.

@ollef
Copy link
Collaborator Author

ollef commented Mar 9, 2021

I've fixed a problem with omitNothingFields and added support for testing with different options to haskell-to-elm-test. It's still a bit manual though, and we should find a way to automate it.

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

No branches or pull requests

2 participants