Git Product home page Git Product logo

Comments (11)

7sharp9 avatar 7sharp9 commented on May 28, 2024

Discussed this here: fsprojects/Fleece#65
Requires substantial effort so marking as nice addition for now.

from falanx.

7sharp9 avatar 7sharp9 commented on May 28, 2024

After discussion with @gusty we think this is best done in Fleece.

from falanx.

7sharp9 avatar 7sharp9 commented on May 28, 2024

@gusty Can you remember what needs to be done for this?

from falanx.

gusty avatar gusty commented on May 28, 2024

Yes, there's no built-in support in Fleece for enums.

We can add a default codec there, based either on numbers or names. We need to decide which, it sounds to me that names are best suited for human-readable json.

Otherwise, since enums can't contain static members, the only way to encode them externally is by using explicit combinators.

Let me know which way you would prefer to move forward, for Falanx.

from falanx.

7sharp9 avatar 7sharp9 commented on May 28, 2024

@gusty I think the reasoning around json encoding is to be more human readable so lets just go for names for now although the proto definition of json encoding is this:

enum | string | "FOO_BAR" |
The name of the enum value as specified in proto is used. Parsers accept both enum names and integer values.

from falanx.

gusty avatar gusty commented on May 28, 2024

OK, let's add an overload for this.

from falanx.

gusty avatar gusty commented on May 28, 2024

This is done in Fleece. Once a new nuget is created we should be able to reference it and fix this.

from falanx.

gusty avatar gusty commented on May 28, 2024

BTW: I think this

Parsers accept both enum names and integer values.

is also doable in Fleece, the question is whether it makes sense, as it would work one way only.

from falanx.

gusty avatar gusty commented on May 28, 2024

Why closing this without merging #169 ?

from falanx.

gusty avatar gusty commented on May 28, 2024

Just for the sake of closing it? But the issue is real and the PR that would solve it is not merged.

from falanx.

gusty avatar gusty commented on May 28, 2024

I know, but in the OSS world you never know who's using what.

If you're not the maintainer and can't merge the PR that will effectively close this issue, you should leave it open.

By closing it this way you are giving the false information that the issue is resolved, when is not.

from falanx.

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.