diff --git a/changelog/18934.txt b/changelog/18934.txt new file mode 100644 index 000000000000..e84f6667ccb2 --- /dev/null +++ b/changelog/18934.txt @@ -0,0 +1,3 @@ +```release-note:improvement +openapi: Change gen_openapi.sh to generate schema with generic mount paths +``` diff --git a/scripts/gen_openapi.sh b/scripts/gen_openapi.sh index 0119a3198bb6..b92fb883b9ad 100755 --- a/scripts/gen_openapi.sh +++ b/scripts/gen_openapi.sh @@ -36,7 +36,7 @@ while read -r line; do codeLinesStarted=true elif [[ $line == *"databasePlugins:"* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then auth_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then auth_plugin_current=${BASH_REMATCH[1]} @@ -63,7 +63,7 @@ while read -r line; do codeLinesStarted=true elif [[ $line == *"addExternalPlugins("* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then secrets_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then secrets_plugin_current=${BASH_REMATCH[1]} @@ -94,7 +94,7 @@ if [ -f $entRegFile ] && [[ -n "${VAULT_LICENSE}" ]]; then codeLinesStarted=true elif [[ $line == *"addExtPluginsEntImpl("* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then secrets_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then ent_plugin_current=${BASH_REMATCH[1]} @@ -116,9 +116,13 @@ fi # Output OpenAPI, optionally formatted if [ "$1" == "-p" ]; then - curl -H "X-Vault-Token: root" "http://127.0.0.1:8200/v1/sys/internal/specs/openapi" | jq > openapi.json + curl --header 'X-Vault-Token: root' \ + --data '{"generic_mount_paths": true}' \ + 'http://127.0.0.1:8200/v1/sys/internal/specs/openapi' | jq > openapi.json else - curl -H "X-Vault-Token: root" "http://127.0.0.1:8200/v1/sys/internal/specs/openapi" > openapi.json + curl --header 'X-Vault-Token: root' \ + --data '{"generic_mount_paths": true}' \ + 'http://127.0.0.1:8200/v1/sys/internal/specs/openapi' > openapi.json fi kill $VAULT_PID