diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java similarity index 99% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_common/ErrorCause.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java index 4b57409faf..65f2ba5a5f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/ErrorCause.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java @@ -34,7 +34,7 @@ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- -package org.opensearch.client.opensearch._common; +package org.opensearch.client.opensearch._types; import jakarta.json.stream.JsonGenerator; import java.util.List; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/ExpandWildcard.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ExpandWildcard.java similarity index 97% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_common/ExpandWildcard.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/ExpandWildcard.java index f8216b7795..adcc4cc776 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/ExpandWildcard.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ExpandWildcard.java @@ -34,7 +34,7 @@ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- -package org.opensearch.client.opensearch._common; +package org.opensearch.client.opensearch._types; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/NodeStatistics.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java similarity index 99% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_common/NodeStatistics.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java index 8a82dd0eaf..0232e6292d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_common/NodeStatistics.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java @@ -34,7 +34,7 @@ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- -package org.opensearch.client.opensearch._common; +package org.opensearch.client.opensearch._types; import jakarta.json.stream.JsonGenerator; import java.util.List; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java index d5fb9fa5a7..9884e5b610 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java @@ -42,8 +42,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opensearch.client.opensearch._common.ExpandWildcard; import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.ExpandWildcard; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/_common/NodesResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesResponseBase.java similarity index 97% rename from java-client/src/generated/java/org/opensearch/client/opensearch/nodes/_common/NodesResponseBase.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesResponseBase.java index f0a71b7eab..df045a171f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/_common/NodesResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesResponseBase.java @@ -34,7 +34,7 @@ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- -package org.opensearch.client.opensearch.nodes._common; +package org.opensearch.client.opensearch.nodes; import jakarta.json.stream.JsonGenerator; import java.util.function.Function; @@ -45,7 +45,7 @@ import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch._common.NodeStatistics; +import org.opensearch.client.opensearch._types.NodeStatistics; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/UsageResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/UsageResponse.java index 44503cccfe..2c65f0fb1d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/UsageResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/UsageResponse.java @@ -46,7 +46,6 @@ import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch.nodes._common.NodesResponseBase; import org.opensearch.client.opensearch.nodes.usage.NodeUsage; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java index f20c926240..19fdcdab10 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java @@ -60,8 +60,6 @@ public Namespace child(String name) { var childName = idx >= 0 ? name.substring(0, idx) : name; var grandChildName = idx >= 0 ? name.substring(idx + 1) : null; - // if ("_common".equals(childName) && this.parent != null) return child(grandChildName); - Namespace child = children.computeIfAbsent(childName, n -> new Namespace(this, n)); return grandChildName == null ? child : child.child(grandChildName); } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiSchema.java b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiSchema.java index 197edc4ea5..4a39e9a859 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiSchema.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiSchema.java @@ -130,7 +130,9 @@ public String getName() { public String getNamespace() { var schemaFile = Path.of(getParent().getLocation().getPath()).getFileName().toString(); - return schemaFile.substring(0, schemaFile.lastIndexOf('.')); + var ns = schemaFile.substring(0, schemaFile.lastIndexOf('.')); + // Match existing naming scheme + return ns.replaceAll("\\._common", "").replaceAll("^_common", "_types"); } @Override