Skip to content

Commit

Permalink
Removing unsupported field runtime for PutMappingRequest
Browse files Browse the repository at this point in the history
Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah committed Aug 17, 2023
1 parent ddff6ce commit 5b08892
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 64 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed
- Fix version and build ([#254](https://github.com/opensearch-project/opensearch-java/pull/254))
- Fix PutMappingRequest by removing unsupported fields ([#597](https://github.com/opensearch-project/opensearch-java/pull/597))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ public class PutMappingRequest extends RequestBase implements JsonpSerializable

private final Map<String, Property> properties;

private final Map<String, RuntimeField> runtime;

@Nullable
private final Time timeout;

Expand All @@ -143,7 +141,6 @@ private PutMappingRequest(Builder builder) {
this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.numericDetection = builder.numericDetection;
this.properties = ApiTypeHelper.unmodifiable(builder.properties);
this.runtime = ApiTypeHelper.unmodifiable(builder.runtime);
this.timeout = builder.timeout;
this.writeIndexOnly = builder.writeIndexOnly;

Expand Down Expand Up @@ -323,15 +320,6 @@ public final Map<String, Property> properties() {
return this.properties;
}

/**
* Mapping of runtime fields for the index.
* <p>
* API name: {@code runtime}
*/
public final Map<String, RuntimeField> runtime() {
return this.runtime;
}

/**
* Explicit operation timeout
* <p>
Expand Down Expand Up @@ -443,18 +431,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();

}
if (ApiTypeHelper.isDefined(this.runtime)) {
generator.writeKey("runtime");
generator.writeStartObject();
for (Map.Entry<String, RuntimeField> item0 : this.runtime.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);

}
generator.writeEnd();

}

}

// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -512,9 +488,6 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<P
@Nullable
private Map<String, Property> properties;

@Nullable
private Map<String, RuntimeField> runtime;

@Nullable
private Time timeout;

Expand Down Expand Up @@ -856,41 +829,6 @@ public final Builder properties(String key, Function<Property.Builder, ObjectBui
return properties(key, fn.apply(new Property.Builder()).build());
}

/**
* Mapping of runtime fields for the index.
* <p>
* API name: {@code runtime}
* <p>
* Adds all entries of <code>map</code> to <code>runtime</code>.
*/
public final Builder runtime(Map<String, RuntimeField> map) {
this.runtime = _mapPutAll(this.runtime, map);
return this;
}

/**
* Mapping of runtime fields for the index.
* <p>
* API name: {@code runtime}
* <p>
* Adds an entry to <code>runtime</code>.
*/
public final Builder runtime(String key, RuntimeField value) {
this.runtime = _mapPut(this.runtime, key, value);
return this;
}

/**
* Mapping of runtime fields for the index.
* <p>
* API name: {@code runtime}
* <p>
* Adds an entry to <code>runtime</code> using a builder lambda.
*/
public final Builder runtime(String key, Function<RuntimeField.Builder, ObjectBuilder<RuntimeField>> fn) {
return runtime(key, fn.apply(new RuntimeField.Builder()).build());
}

/**
* Explicit operation timeout
* <p>
Expand Down Expand Up @@ -956,8 +894,6 @@ protected static void setupPutMappingRequestDeserializer(ObjectDeserializer<PutM
JsonpDeserializer.stringMapDeserializer(DynamicTemplate._DESERIALIZER)), "dynamic_templates");
op.add(Builder::numericDetection, JsonpDeserializer.booleanDeserializer(), "numeric_detection");
op.add(Builder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER), "properties");
op.add(Builder::runtime, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER), "runtime");

}

// ---------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 5b08892

Please sign in to comment.