Giter Club home page Giter Club logo

jackson-dataformat-ron's Issues

RON field ordering

How can we address RON field ordering in this library?

To do:

  • Use a Java Map subtype that preserves order e.g. LinkedHashMap

Add trailing commas write feature

Add a RON write feature (in the style of JsonWriteFeatures) which lets the user decide whether the generator should write trailing commas or not.

Support enums that contain fields

Find a way to support enums that contain fields in the mapper.

Example:

Foo(1, true)

The JSON ObjectMapper does not support these, so there is no prior code in Jackson to fall back on.

Ask for upstream changes in Jackson-core

The Jackson Core superclasses have some aspects that make them awkward to specialise for RON. Ask for changes in upstream to make this easier.

  • JsonStreamContext#inArray() is final. We need to override this, so ask for the final modifier to be removed.
  • JsonStreamContext#inRoot() is final. We need to override this, so ask for the final modifier to be removed.
  • JsonStreamContext#inObject() is final. We need to override this, so ask for the final modifier to be removed.
  • JsonParser#nextToken() returns JsonToken which is an enum. This means it can't be extended to add RON concepts like START_TUPLE/END_TUPLE. So we have to provide the awkward nextRONToken method adjacent to it. Ask for this to be changed into something that can handle extension, e.g. make JsonToken an interface.
  • MapperFeature is an enum. This means it can't be extended to add RON concepts (like say WRITE_STRUCT_NAMES) to the RONMapper.

Support tuples

Tuples are difficult because Java doesn't natively support them. Observing RON field ordering in Java is also an issue. Is there a way to make tuples work in the RONMapper (reading or writing)?

Some options:

  • Read tuples to Collection<Object>
    • Optionally allow some specialisation of the generic type if all elements have some commonality e.g. Collection<Number>
  • Use a 3rd party tuple library like javatuples
  • Wait for JDK to add native tuples one day

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.