Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonXContentGenerator#writeRawField produces invalid JSON if raw field is the first field in the json object #5514

Closed
s1monw opened this issue Mar 24, 2014 · 1 comment

Comments

@s1monw
Copy link
Contributor

s1monw commented Mar 24, 2014

XContentBuilder xContentBuilder = XContentFactory.contentBuilder(XContentType.JSON);
xContentBuilder.startObject();
xContentBuilder.rawField("foo", new BytesArray("{\"test\":\"value\"}"));
xContentBuilder.endObject();

results in the following string:

{,"foo":{"test":"value"}}
@s1monw s1monw added the bug label Mar 24, 2014
@javanna
Copy link
Member

javanna commented Mar 24, 2014

I think this is a duplicate of #2897 ;)

@s1monw s1monw closed this as completed in c2e6aa2 Mar 24, 2014
s1monw added a commit that referenced this issue Mar 24, 2014
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes #5514
s1monw added a commit that referenced this issue Mar 24, 2014
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes #5514
s1monw added a commit that referenced this issue Mar 24, 2014
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes #5514
s1monw added a commit that referenced this issue Mar 24, 2014
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes #5514
@s1monw s1monw added v0.90.13 and removed v1.0.0 labels Mar 24, 2014
@clintongormley clintongormley added the :Core/Infra/Transport API Transport client API label Jun 7, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes elastic#5514
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes elastic#5514
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…iteRawField

The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes elastic#5514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants