Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8092777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:21:33+00:00 2026-06-05T20:21:33+00:00

I have the following class…. @XmlType @XmlRootElement(name = milestones) @XmlAccessorType(XmlAccessType.FIELD) public static class Circle

  • 0

I have the following class….

@XmlType
@XmlRootElement(name = "milestones")
@XmlAccessorType(XmlAccessType.FIELD)
public static class Circle {
    public String type = "circle";
    public double cx;
    public double cy;
    public int r;
    public String title;
    public Integer width;   
}

I am returning a List of Circles (actually using JaxRS with RestEasy, which uses Jackson)

I want the Json output to be like

[{"type":"circle","cx":100.0,"cy":100.0,"r":0,"title":"test1","width":2},
{"type":"circle","cx":150.0,"cy":150.0,"r":0,"title":"test2","width":0}]

and on my dev machine that is how the output looks, but on production it is like

[{"milestones":{"type":"circle","cx":100,"cy":100,"r":0,"title":"test1","width":2}}, 
{"milestones":{"type":"circle","cx":150,"cy":150,"r":0,"title":"test2","width":0}}]

Is there a way to force it to use the first output format (without the name listed)?

Thanks for your help,
Mason

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:21:34+00:00Added an answer on June 5, 2026 at 8:21 pm

    With the same codebase its highly unlikely that the outputs are different on the two machines.

    This behaviour is driven by the WRAP_ROOT_VALUE feature of the ObjectMapper, so you might want to try turning it explicitly off using the code below (you might also want to check if it is being exlicitly turned on somewhere in your code, as by default this feature is disabled)

    mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, false);
    

    Since you are using RestEasy, you will need to extend the RestEasyJacksonProvider to get access to the underlying ObjectMapper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class A. public class A { public string Name {
Lets say i have following class public class abc { int id; string name;
I have the following class: public class Movie { string Name get; set; string
I have the following class: public abstract class AbstractParent { static String method() {
I have the following class public class MenuVeiculo { public string Nome { get;
I have following class with one static method: public class Helper { public static
I have following code: class TR_AgentInfo : public tuple< long long, //AgentId string, //AgentIp
I have 3 following classes: public class BaseProperty1{ public string Property1 {get; set;} }
If have following class public abstract class MyBaseClass : BaseClass { public override string
I have the following class public class Car { public Name {get; set;} }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.