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

Duplicate record fields #38

Open
agentultra opened this issue Dec 6, 2019 · 5 comments
Open

Duplicate record fields #38

agentultra opened this issue Dec 6, 2019 · 5 comments
Labels
beginner enhancement good-first-issue patches-welcome Developers welcome patches or suggestions how it is solved in other libraries.

Comments

@agentultra
Copy link
Contributor

agentultra commented Dec 6, 2019

{
  "synced": true,
  "__synced": true
}

Will generate a record with a duplicated field name

data TopLevel = TopLevel {
    topLevelSynced :: Bool,
    topLevelSynced :: Bool
} deriving (Show,Eq,GHC.Generics.Generic)
@mgajda
Copy link
Collaborator

mgajda commented Feb 6, 2020

Good point!
We have just started an implementation of code generation monad that works around this issue,
I am willing to tutor anybody that wants to implement this.

@mgajda mgajda added beginner enhancement patches-welcome Developers welcome patches or suggestions how it is solved in other libraries. good-first-issue labels Feb 6, 2020
@sigrlami
Copy link
Contributor

@agentultra @mgajda I stumbled into a similar issue working with 3rd party API. What would be the appropriate handler for this? Enumeration might be a good choice to resolve the conflict but it doesn't provide enough context later on.

@mgajda
Copy link
Collaborator

mgajda commented Apr 17, 2020

@sigrlami Good way to fix this would be to implement the same CodeGen monad as used in xml-typelift.
Here is the presentation: https://www.migamake.com/presi/art-of-industrial-code-generation-mar-6-2019-uog-singapore.pdf

I can mentor the change, but at the moment I am rather busy making next-gen type inference for json-autotype.

@agentultra Would your work also fix this issue?

@agentultra
Copy link
Contributor Author

Sure would

@EskoJTH
Copy link

EskoJTH commented Mar 29, 2023

Same issue occurs also with capital letters:

{
  "Synced": true,
  "synced": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner enhancement good-first-issue patches-welcome Developers welcome patches or suggestions how it is solved in other libraries.
Projects
None yet
Development

No branches or pull requests

4 participants