diff --git a/changelog/18935.txt b/changelog/18935.txt new file mode 100644 index 000000000..c55cda115 --- /dev/null +++ b/changelog/18935.txt @@ -0,0 +1,3 @@ +```release-note:improvement +openapi: Add default values to thing_mount_path parameters +``` diff --git a/sdk/framework/openapi.go b/sdk/framework/openapi.go index 692062edc..579066728 100644 --- a/sdk/framework/openapi.go +++ b/sdk/framework/openapi.go @@ -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) diff --git a/vault/logical_system.go b/vault/logical_system.go index 057a1f1b5..47c75676e 100644 --- a/vault/logical_system.go +++ b/vault/logical_system.go @@ -4606,9 +4606,10 @@ func (b *SystemBackend) pathInternalOpenAPI(ctx context.Context, req *logical.Re Description: "Path that the backend was mounted at", In: "path", Schema: &framework.OASSchema{ - Type: "string", + Type: "string", + Default: strings.TrimRight(mount, "/"), }, - Required: true, + Required: false, }) }