From c5ecc087975ded510d4e4c41be532c39e9c08692 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Fri, 29 Nov 2024 22:41:23 -0800 Subject: [PATCH] fix: make API required determinate there is some non-determinism due to map ordering in the generation of the API. Fixing that to ensures tests pass. --- parser/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parser/utils.go b/parser/utils.go index 69fb41c..25d38a9 100644 --- a/parser/utils.go +++ b/parser/utils.go @@ -2,6 +2,7 @@ package parser import ( "fmt" + "sort" "github.com/aep-dev/aep-lib-go/pkg/openapi" "github.com/aep-dev/aepc/schema" @@ -68,6 +69,7 @@ func toOpenAPISchemaFromPropMap(propMap map[string]*schema.Property) (*openapi.S } field_numbers[int(p.GetNumber())] = name } + sort.Strings(required) return &openapi.Schema{ Type: "object", Properties: properties,