# Post Avro Protocol Can't get text on a START\_OBJECT

**URL:** <https://discuss.elastic.co/t/post-avro-protocol-cant-get-text-on-a-start-object/129845>\
**Category:** Elasticsearch\
**Created:** [April 27, 2018, 2:38pm UTC](https://discuss.elastic.co/t/post-avro-protocol-cant-get-text-on-a-start-object/129845 "2018-04-27T14:38:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverG](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@OliverG](https://discuss.elastic.co/u/OliverG)\
**Post date:** [April 27, 2018, 2:38pm UTC](https://discuss.elastic.co/t/post-avro-protocol-cant-get-text-on-a-start-object/129845/1 "2018-04-27T14:38:01Z")

</div>

Good Morning,  
I am looking for some insight into why posting this json document doesn't work in certain scenarios.  
We are working with ElasticSearch and wanting to store an Avro protocol.

This is what the Avro protocol looks like (I omitted the sub namespace). It will not get inserted into ElasticSearch and gives the following error.

Keep in mind that we are not looking to use ES5 functionality of multiple types per index. This is just how the Avro protocols are defined.

org.elasticsearch.client.ResponseException: method [POST], host [[http://domain.com:9200](http://domain.com:9200)], URI [/myIndex/myId], status line [HTTP/1.1 400 Bad Request]  
{"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse [types.fields]"}],"type":"mapper\_parsing\_exception","reason":"failed to parse [types.fields]","caused\_by":{"type":"illegal\_state\_exception","reason":"Can't get text on a START\_OBJECT at 1:192"}},"status":400}

"fields" seems to be a keyword in mappings when creating an index so shouldn't affect this. Is that correct?

This document does not work.  
`POST /myIndex/myId { "protocol": "protocolName", "namespace": "com.namespace", "types": [{ "namespace": "com.namespace.name", "type": "record", "name": "myName", "fields": [{ "type": { "items": "com.namespace.another.namespace", "type": "array" }, "name": "subName" }] }] }`

Changing the "type" object to just "int" still doesn't work with same error.  
`POST /myIndex/myId { "protocol": "protocolName", "namespace": "com.namespace", "types": [{ "namespace": "com.namespace.name", "type": "record", "name": "myName", "fields": [{ "type": "int", "name": "subName" }] }] }`

Changing "fields" to "testName" keeping the "type" an object doesn't work.  
`POST /myIndex/myId { "protocol": "protocolName", "namespace": "com.namespace", "types": [{ "namespace": "com.namespace.name", "type": "record", "name": "myName", "testName": [{ "type": { "items": "com.namespace.another.namespace", "type": "array" }, "name": "subName" }] }] }`

Changing "fields" to "testName" with the "type" from object to "int" works.  
`POST /myIndex/myId { "protocol": "protocolName", "namespace": "com.namespace", "types": [{ "namespace": "com.namespace.name", "type": "record", "name": "myName", "testName": [{ "type": "int", "name": "subName" }] }] }`

Thank you

---

<div class="post-metadata">

**Author:** ![OliverG](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@OliverG](https://discuss.elastic.co/u/OliverG)\
**Post date:** [May 3, 2018, 12:10pm UTC](https://discuss.elastic.co/t/post-avro-protocol-cant-get-text-on-a-start-object/129845/2 "2018-05-03T12:10:16Z")

</div>

Bumping

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 31, 2018, 12:10pm UTC](https://discuss.elastic.co/t/post-avro-protocol-cant-get-text-on-a-start-object/129845/3 "2018-05-31T12:10:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
