From be4979dfbbe09a04d4fe1ca7a2a22418ba2468d0 Mon Sep 17 00:00:00 2001 From: Anton Averchenkov <84287187+averche@users.noreply.github.com> Date: Mon, 5 Jun 2023 13:25:55 -0400 Subject: [PATCH] openapi: Fix generated types for duration strings (#20841) --- changelog/20841.txt | 3 +++ sdk/framework/openapi.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/20841.txt diff --git a/changelog/20841.txt b/changelog/20841.txt new file mode 100644 index 000000000000..26a8d6316312 --- /dev/null +++ b/changelog/20841.txt @@ -0,0 +1,3 @@ +```release-note:improvement +openapi: Fix generated types for duration strings +``` diff --git a/sdk/framework/openapi.go b/sdk/framework/openapi.go index 53e7ee256c30..663386a179d6 100644 --- a/sdk/framework/openapi.go +++ b/sdk/framework/openapi.go @@ -922,8 +922,8 @@ func convertType(t FieldType) schemaType { ret.baseType = "integer" ret.format = "int64" case TypeDurationSecond, TypeSignedDurationSecond: - ret.baseType = "integer" - ret.format = "seconds" + ret.baseType = "string" + ret.format = "duration" case TypeBool: ret.baseType = "boolean" case TypeMap: