# Convert Elasticsearch mapping to JSON or Avro schema

**URL:** <https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545>\
**Category:** Elasticsearch\
**Created:** [April 6, 2016, 2:47pm UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545 "2016-04-06T14:47:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [April 6, 2016, 2:47pm UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545/1 "2016-04-06T14:47:33Z")

</div>

Is it possible to convert the mapping of one of my indexes to a JSON or an Avro schema? I think that's not possible with Elasticsearch, but maybe you know other tools to achieve that conversion. Thank you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 7, 2016, 1:51am UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545/2 "2016-04-07T01:51:20Z")

</div>

Mappings are in json already.

---

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [April 7, 2016, 6:54am UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545/3 "2016-04-07T06:54:36Z")

</div>

Thanks, Mark. They are in JSON, but they are not a standard JSONSchema describing the fields and types. I need to convert it into a standard Avro schema o JSONSchema.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 24, 2016, 7:44pm UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545/4 "2016-04-24T19:44:57Z")

</div>

There's nothing native in ES to convert index mappings to JSON Schema. Perhaps someone has written a script for it?

---

<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:** [July 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/convert-elasticsearch-mapping-to-json-or-avro-schema/46545/5 "2017-07-05T22:56:38Z")

</div>


