openapi: Post request body does not show the request schema in custom plugins
Describe the bug
If a custom plugin is added to Vault, OpenAPI Explorer does not show properly the Request body for the plugin's POST endpoints. It shows a "string" instead of filling out the parameters based on the path fields.
This is due to github.com/mitchellh/mapstructure. When it goes through the OpenAPI map (as the specification is retrieved through a map), it tries to match the map key with a struct field with a simple case-insensitive match, Ref does not match with $ref, and the values are ignored.
To Reproduce Steps to reproduce the behavior:
- Add a custom Vault plugin to Vault (such as vault-auth-plugin-example)
- Log in to Vault and open API Explorer
- Check a
POSTendpoint of the custom plugin - Request body shows "string" instead of a Schema.
Expected behavior Request body shows a schema.
Environment:
- Vault Server Version (retrieve with
vault status): 1.19.4 - Vault CLI Version (retrieve with
vault version): v1.19.4 - Server Operating System/Architecture: macOS 15.5 (24F74)
Vault server configuration file(s):
plugin_directory = "<vault folder>/plugins"
Additional context In order to add a custom plugin, I followed the "Register a plugin" documentation.