From 0d7d0a65a8049fa17485e8e68189a2db79487d5d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 13 Nov 2022 00:37:53 -0500 Subject: [PATCH] update certain properties to be required in openapi.yaml (#8) --- api/message_bus/openapi.yaml | 5 +++++ route/adapter/in/property.go | 4 ++-- route/adapter/in/property_type.go | 2 +- route/adapter/out/property.go | 4 ++-- route/adapter/out/property_type.go | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api/message_bus/openapi.yaml b/api/message_bus/openapi.yaml index f97bc01..d98c8c9 100644 --- a/api/message_bus/openapi.yaml +++ b/api/message_bus/openapi.yaml @@ -458,6 +458,8 @@ components: PropertyType: type: object + required: + - "name" properties: name: type: string @@ -497,6 +499,9 @@ components: Property: type: object + required: + - "name" + - "value" properties: name: type: string diff --git a/route/adapter/in/property.go b/route/adapter/in/property.go index 89e136a..2e6fdfe 100644 --- a/route/adapter/in/property.go +++ b/route/adapter/in/property.go @@ -7,7 +7,7 @@ import ( func PropertyAdapter(property codegen.Property) model.Property { return model.Property{ - Name: *property.Name, - Value: *property.Value, + Name: property.Name, + Value: property.Value, } } diff --git a/route/adapter/in/property_type.go b/route/adapter/in/property_type.go index 025dfba..0159a6a 100644 --- a/route/adapter/in/property_type.go +++ b/route/adapter/in/property_type.go @@ -7,6 +7,6 @@ import ( func PropertyTypeAdapter(propertyType codegen.PropertyType) model.PropertyType { return model.PropertyType{ - Name: *propertyType.Name, + Name: propertyType.Name, } } diff --git a/route/adapter/out/property.go b/route/adapter/out/property.go index 53ada18..fb5bac4 100644 --- a/route/adapter/out/property.go +++ b/route/adapter/out/property.go @@ -7,7 +7,7 @@ import ( func PropertyAdapter(property model.Property) codegen.Property { return codegen.Property{ - Name: &property.Name, - Value: &property.Value, + Name: property.Name, + Value: property.Value, } } diff --git a/route/adapter/out/property_type.go b/route/adapter/out/property_type.go index f4b9ac1..18af9e1 100644 --- a/route/adapter/out/property_type.go +++ b/route/adapter/out/property_type.go @@ -7,6 +7,6 @@ import ( func PropertyTypeAdapter(propertyType model.PropertyType) codegen.PropertyType { return codegen.PropertyType{ - Name: &propertyType.Name, + Name: propertyType.Name, } }