Git Product home page Git Product logo

Comments (5)

giacomociti avatar giacomociti commented on May 24, 2024 1

hello @buvinghausen, using element names instead of types was a design decision.

Switching to a different design may not be trivial, and at the moment I have no specific advice for minimizing impacts.
But If I can find the time to think more about it, I will share my thoughts here.

from fsharp.data.

giacomociti avatar giacomociti commented on May 24, 2024 1

in the meantime, to mitigate the annoying problem of mapping between distinct but equivalent types, you may leverage the constructor with XElement:

let b1 = 
    DupeProvider.Branch(
        replicationId=Some "repId", 
        branchId= Some 1, 
        branchName=Some "b",
        isActive = Some true,
        location = None,
        contact = None)
let b2 = DupeProvider.Branches2(b1.XElement)

from fsharp.data.

buvinghausen avatar buvinghausen commented on May 24, 2024 1

@giacomociti quick update after applying your workaround.... first it works marvelously and at least cuts down my primary problem which was having multiple mapping functions for each cartesian product of complex type and unique names. I also fully understand your original design decision it makes perfect sense for someone to have less friction going from samples to schema. With that said I definitely would like the ability to opt into explicit schema mode that only renders back a type per complex type to cut down on all the XML element juggling. I don't see this as a pressing need any longer and so it could be planned into a future release when it makes sense. Thanks again for the assist.

from fsharp.data.

buvinghausen avatar buvinghausen commented on May 24, 2024

@giacomociti it seems like XsdInference.fs is your baby do you have any suggestions on a solution that will cause the least amount of impacts to the XmlProvider for existing implementations?

from fsharp.data.

buvinghausen avatar buvinghausen commented on May 24, 2024

@giacomociti thanks for the insight I'll give that a try and that should at least alleviate the need for all the duplicative mapping functions which would at least be a viable workaround.

from fsharp.data.

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.