dynamic flag on object type should lower case itself when serialized back to its json representation

This commit is contained in:
kimchy 2011-02-08 11:38:02 +02:00
parent 05283c7f6d
commit 43a95de9db
1 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ public class ObjectMapper implements XContentMapper, IncludeInAllMapper {
if (fieldName.equals("dynamic")) {
String value = fieldNode.toString();
if (value.equals("strict")) {
if (value.equalsIgnoreCase("strict")) {
builder.dynamic(Dynamic.STRICT);
} else {
builder.dynamic(nodeBooleanValue(fieldNode) ? Dynamic.TRUE : Dynamic.FALSE);
@ -590,11 +590,11 @@ public class ObjectMapper implements XContentMapper, IncludeInAllMapper {
// inherit the root behavior
if (this instanceof RootObjectMapper) {
if (dynamic != Dynamic.TRUE) {
builder.field("dynamic", dynamic);
builder.field("dynamic", dynamic.name().toLowerCase());
}
} else {
if (dynamic != Defaults.DYNAMIC) {
builder.field("dynamic", dynamic);
builder.field("dynamic", dynamic.name().toLowerCase());
}
}
if (enabled != Defaults.ENABLED) {