Giter Site home page Giter Site logo

Comments (7)

meriouma avatar meriouma commented on July 29, 2024

I ended up writing my own JsonSerializer<String> which only does : writer.rawValue("\"" + value.replaceAll("\"", "\\\\\"") + "\"");

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

There is also @JsonRawValue that calls writer.rawValue but the characters won't be escaped.

Jackson seems to be able to serialize a string containing json. I'll see what I can do in JsonWriter.

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

Found the problem. I took JsonWriter from gson but gson is using java.io.Writer.write(String str, int off, int len) and I replaced it for StringBuilder.append(CharSequence s, int start, int end).
Notice the change in last parameter name, same signature but different meaning. So the compilation was ok but not the behaviour :)

I thought my writer was ok since all the tests from gson were working!

I'll do some more tests and commit a fix. There should be a snpashot version available with the fix by tomorrow.

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

The snapshot should be available. If you need a release version, let me know.

from gwt-jackson.

meriouma avatar meriouma commented on July 29, 2024

Thank you, it works perfectly!

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

You're welcome :)

from gwt-jackson.

christiangoudreau avatar christiangoudreau commented on July 29, 2024

Yes, this is needed, if you can release a new version, that would be appreciated! :D

from gwt-jackson.

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.