aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@ydb.tech>2024-10-17 10:40:33 +0200
committerGitHub <noreply@github.com>2024-10-17 10:40:33 +0200
commit92770f6e7b82211949f3163a25a2f89812f4e0ea (patch)
tree2f5d85504294b74cfab0978639e97cba2ca54ce9
parent91a3c8781d8d607508ffc737ac2eae309829ebfa (diff)
downloadydb-92770f6e7b82211949f3163a25a2f89812f4e0ea.tar.gz
do not convert google datetime to string in schema (#10487)
-rw-r--r--ydb/core/viewer/json/json.cpp4
-rw-r--r--ydb/core/viewer/yaml/yaml.cpp5
2 files changed, 2 insertions, 7 deletions
diff --git a/ydb/core/viewer/json/json.cpp b/ydb/core/viewer/json/json.cpp
index af5acc4dcc..d3cbd6b0ce 100644
--- a/ydb/core/viewer/json/json.cpp
+++ b/ydb/core/viewer/json/json.cpp
@@ -492,9 +492,7 @@ void TProtoToJson::ProtoToJsonSchema(IOutputStream& to, const TJsonSettings& jso
to << "{\"type\":\"array\",\"items\":";
}
if (fieldDescriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
- if (fieldDescriptor->message_type()->full_name() == google::protobuf::Timestamp::descriptor()->full_name()) {
- to << "{\"type\":\"string\",\"format\":\"date-time\"}";
- } else if (fieldDescriptor->message_type()->full_name() == google::protobuf::Duration::descriptor()->full_name()) {
+ if (fieldDescriptor->message_type()->full_name() == google::protobuf::Duration::descriptor()->full_name()) {
to << "{\"type\":\"string\", \"example\":\"3600s\"}";
} else if (fieldDescriptor->message_type()->full_name() == google::protobuf::BoolValue::descriptor()->full_name()) {
to << "{\"type\":\"boolean\"}";
diff --git a/ydb/core/viewer/yaml/yaml.cpp b/ydb/core/viewer/yaml/yaml.cpp
index c2175e1285..b87785fe8f 100644
--- a/ydb/core/viewer/yaml/yaml.cpp
+++ b/ydb/core/viewer/yaml/yaml.cpp
@@ -60,10 +60,7 @@ YAML::Node TProtoToYaml::ProtoToYamlSchema(const ::google::protobuf::Descriptor*
property.reset(property["items"]);
}
if (fieldDescriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
- if (fieldDescriptor->message_type()->full_name() == google::protobuf::Timestamp::descriptor()->full_name()) {
- property["type"] = "string";
- property["format"] = "date-time";
- } else if (fieldDescriptor->message_type()->full_name() == google::protobuf::Duration::descriptor()->full_name()) {
+ if (fieldDescriptor->message_type()->full_name() == google::protobuf::Duration::descriptor()->full_name()) {
property["type"] = "string";
property["example"] = "3600s";
} else if (fieldDescriptor->message_type()->full_name() == google::protobuf::BoolValue::descriptor()->full_name()) {