Giter Site home page Giter Site logo

Mapping to sealed class about auto_mappr HOT 3 CLOSED

WoodyMKD avatar WoodyMKD commented on May 30, 2024
Mapping to sealed class

from auto_mappr.

Comments (3)

tenhobi avatar tenhobi commented on May 30, 2024 1

Hi @WoodyMKD, so I checked this case and it seems it's more less the same like situation mentioned in #29.

Basically, this package states that it works with freezed, meaning that it can be both used together. Mapping have to be however specified on case to case basis, since I am not sure we can easily generate code that would support mapping of essentially disjunctive cases. So don't try to tell mappr "map A or B or C or D or E... into X or Y or Z..." but rather "map A to X, map B to Y, map C to Z, ..." and that will be both more clear to you as it will do exactly what you want anytime and also mappr don't have to do some black magic and guess :D

Similar thing also applies to sealed classes, where you also don't want to use that sealed class as a source or target but map it's specific types. We should probably clarify that more in docs. 🤔

from auto_mappr.

tenhobi avatar tenhobi commented on May 30, 2024

Hi! Thanks for using the package and I am glad everything works for you other than this case! 🙌

We are at F3.events right now, so we will take a look at this later this week or next one, sorry for inconvenience.

At the meantime, check that Freeze generates fields correctly. 🤔

I can see that also remoteId is missing and both those fields are nullable, so that might be some edge case.

from auto_mappr.

tenhobi avatar tenhobi commented on May 30, 2024

Since it's a week without a response, I am closing the issue now. Feel free to reopen the discussion.

from auto_mappr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.