Skip to content

jackson: support raw string as json response #618

@jknack

Description

@jknack

Given:

{
  use(new Jackson());

  get("/raw", () -> {
     return "{\"json\": \"raw\"}";
  });
}

Produces a escaped json string and doesn't write the raw json string value. This is how Jackson works and there isn't much to do there.

Next release is going to allow to override this to support raw json strings:

{
  use(new Jackson().raw());

  get("/raw", () -> {
     return "{\"json\": \"raw\"}";
  });
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions