Skip to content

Commit

Permalink
Removing unsupported field runtime for PutMappingRequest (#597) (#606)
Browse files Browse the repository at this point in the history
Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored Aug 22, 2023
1 parent 9362d0d commit b4e30f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 65 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
## [Unreleased 2.x](https://github.com/opensearch-project/opensearch-java/compare/v2.6.0...2.x)
### Added

### Dependencies
Expand All @@ -16,6 +16,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Remove generated code comments from all files ([#598](https://github.com/opensearch-project/opensearch-java/pull/598))

### Fixed
- 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 b4e30f2

Please sign in to comment.