Skip to content

Commit

Permalink
fix: make API required determinate (#49)
Browse files Browse the repository at this point in the history
there is some non-determinism due to map 
ordering in the generation of the API.

Fixing that to ensures tests pass.
  • Loading branch information
toumorokoshi authored Nov 30, 2024
1 parent 680a6ff commit 5b1eab1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parser/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package parser

import (
"fmt"
"sort"

"github.com/aep-dev/aep-lib-go/pkg/openapi"
"github.com/aep-dev/aepc/schema"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5b1eab1

Please sign in to comment.