GithubHelp home page GithubHelp logo

Comments (3)

lukewyman avatar lukewyman commented on July 22, 2024

@travisbrown I'd like to take this one if it's still available. Might be a bit of a stretch at my current skill level, but I think I understand the problem in a vague/abstract way.

from circe.

travisbrown avatar travisbrown commented on July 22, 2024

@lukewyman The situation is likely to change soon in #164, largely because the new case object encoding style option means that the generically derived encoders no longer always return JSON objects:

scala> import io.circe.Encoder, io.circe.generic.auto._, io.circe.syntax._
import io.circe.Encoder
import io.circe.generic.auto._
import io.circe.syntax._

scala> sealed trait Base; case object Foo extends Base; case object Bar extends Base
defined trait Base
defined object Foo
defined object Bar

scala> (Foo: Base).asJsonConfigured[io.circe.generic.config.CaseObjectString]
res0: io.circe.Json = "Foo"

This has been one of the most requested configuration options, and the extra guarantees of the ObjectEncoder type class didn't seem useful enough not to provide it.

We'll keep ObjectEncoder around, but the fact that the default generic derivation mechanism isn't using it means that we won't have to worry about this issue as much.

from circe.

hamnis avatar hamnis commented on July 22, 2024

Closing in cleanup run, If anyone cares about this, please comment and I'll reopen.

from circe.

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.