openapi: Add default values to the thing_mount_path parameters (#18935)
This commit is contained in:
parent
6487fe6ae8
commit
7b356f0366
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
openapi: Add default values to thing_mount_path parameters
|
||||
```
|
|
@ -910,6 +910,9 @@ func (d *OASDocument) CreateOperationIDs(context string) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Discard "_mount_path" from any {thing_mount_path} parameters
|
||||
path = strings.Replace(path, "_mount_path", "", 1)
|
||||
|
||||
// Space-split on non-words, title case everything, recombine
|
||||
opID := nonWordRe.ReplaceAllString(strings.ToLower(path), " ")
|
||||
opID = strings.Title(opID)
|
||||
|
|
|
@ -4607,8 +4607,9 @@ func (b *SystemBackend) pathInternalOpenAPI(ctx context.Context, req *logical.Re
|
|||
In: "path",
|
||||
Schema: &framework.OASSchema{
|
||||
Type: "string",
|
||||
Default: strings.TrimRight(mount, "/"),
|
||||
},
|
||||
Required: true,
|
||||
Required: false,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue