vault icon indicating copy to clipboard operation
vault copied to clipboard

openapi: Post request body does not show the request schema in custom plugins

Open berkitamas opened this issue 7 months ago • 0 comments

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:

  1. Add a custom Vault plugin to Vault (such as vault-auth-plugin-example)
  2. Log in to Vault and open API Explorer
  3. Check a POST endpoint of the custom plugin
  4. 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.

berkitamas avatar May 21 '25 22:05 berkitamas