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

The _id path should not allow arrays #2275

Closed
clintongormley opened this issue Sep 21, 2012 · 0 comments · Fixed by #2715
Closed

The _id path should not allow arrays #2275

clintongormley opened this issue Sep 21, 2012 · 0 comments · Fixed by #2715
Assignees

Comments

@clintongormley
Copy link

curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1'  -d '
{
   "mappings" : {
      "test" : {
         "_id" : {
            "path" : "foo.bar"
         }
      }
   }
}
'

This works correctly:

curl -XPOST 'http://127.0.0.1:9200/test/test?pretty=1'  -d '
{
   "foo" : {
      "bar" : 1,
      "baz" : "xx"
   }
}
'

# [Fri Sep 21 11:14:21 2012] Response:
# {
#    "ok" : true,
#    "_index" : "test",
#    "_id" : "1",
#    "_type" : "test",
#    "_version" : 1
# }

This should throw an error, not set the _id to [:

curl -XPOST 'http://127.0.0.1:9200/test/test?pretty=1'  -d '
{
   "foo" : {
      "bar" : [
         2
      ],
      "baz" : "xx"
   }
}
'

# [Fri Sep 21 11:14:23 2012] Response:
# {
#    "ok" : true,
#    "_index" : "test",
#    "_id" : "[",
#    "_type" : "test",
#    "_version" : 1
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants