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

Reject put mapping requests when the root node is not equal to `type` #4038

Closed
bleskes opened this Issue Nov 1, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@bleskes
Copy link
Member

bleskes commented Nov 1, 2013

Currently the put mapping api expects the root node of the body to be the type in question:

curl -XPUT "http://localhost:9200/index/craze_type/_mapping" -d'
{
    "crazy_type": {
        "properties": { ... }
    }

}'

Right now we verify the content has only one root node, but we do not check it's name. This means that the following get's accepted &ignored while returning a 200 OK status:

curl -XPUT "http://localhost:9200/index/craze_type/_mapping" -d'
{
    "properties": { ... }
}'

We should throw a MapperParsingException .

bleskes added a commit to bleskes/elasticsearch that referenced this issue Nov 1, 2013

PutMapping API now throws a MapperParsingException if the mapping's r…
…oot node name is not equal to the type's name.

Fixed tests which were using mapping with the wrong type name as root node.
Removed OverrideTypeMappingTests due to the removal of the functionality it tests.
Better naming for the default percolator mapping and change it's content use _default_ as root node.

Closes elastic#4038

bleskes added a commit that referenced this issue Nov 5, 2013

Fixed tests that were using incosistent type name in their mapping.
In master (1.0.0beta) we have added a check that makes this fail. The check it self is not backported to 0.90 as it is not comptabile but we want to keep the code base as similar as possible.

See #4038

@bleskes bleskes closed this in 0ef2493 Nov 5, 2013

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Fixed tests that were using incosistent type name in their mapping.
In master (1.0.0beta) we have added a check that makes this fail. The check it self is not backported to 0.90 as it is not comptabile but we want to keep the code base as similar as possible.

See elastic#4038
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.