From 1cb838942ec134ad03ce9cc31e0841aebc45b891 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 6 Jun 2024 12:45:11 +1200 Subject: [PATCH] Handle Time type Signed-off-by: Thomas Farr --- .../org/opensearch/client/codegen/model/SpecTransformer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java index f9f3e05ed0..f896fc1dc1 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java @@ -332,6 +332,8 @@ private Type mapTypeInner(OpenApiSchema schema) { case Array: return mapArray(schema); case String: + if (schema.getPattern().map("^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$"::equals).orElse(false)) + return Types.Client.OpenSearch._Types.Time; return Types.Java.Lang.String; case Boolean: return Types.Primitive.Boolean;