backport of commit e65d295c8809f4cc61b63bbc03293586c71c5483 (#20906)
Co-authored-by: Max Bowsher <maxbowsher@gmail.com>
This commit is contained in:
parent
52835311b2
commit
96596f255b
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
sdk/framework: Fix non-deterministic ordering of 'required' fields in OpenAPI spec
|
||||
```
|
|
@ -383,6 +383,10 @@ func documentPath(p *Path, specialPaths *logical.Paths, requestResponsePrefix st
|
|||
s.Properties[name] = &p
|
||||
}
|
||||
|
||||
// Make the ordering deterministic, so that the generated OpenAPI spec document, observed over several
|
||||
// versions, doesn't contain spurious non-semantic changes.
|
||||
sort.Strings(s.Required)
|
||||
|
||||
// If examples were given, use the first one as the sample
|
||||
// of this schema.
|
||||
if len(props.Examples) > 0 {
|
||||
|
|
Loading…
Reference in New Issue