Describe the bug
GET /v1/transit/keys/:name returns a latest_version field, but it is not documented anywhere:
- The Read Key page does not mention it, and the sample response omits it.
- The OpenAPI spec from
/v1/sys/internal/specs/openapi has no response body definition for this endpoint — the 200 is a bare "description": "OK" with no schema reference.
The field is only discoverable by calling the endpoint.
Steps to reproduce
Against hashicorp/vault:2.0.4 in dev mode, with transit enabled:
$ vault write -f transit/keys/foo
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/transit/keys/foo" \
| jq '.data | {name, latest_version, keys}'
{
"name": "foo",
"latest_version": 1,
"keys": { "1": 1787846981 }
}
$ vault write -f transit/keys/foo/rotate
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/transit/keys/foo" \
| jq '.data | {name, latest_version, keys}'
{
"name": "foo",
"latest_version": 2,
"keys": { "1": 1787846981, "2": 1787846983 }
}
Confirming the spec describes no response fields:
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/sys/internal/specs/openapi" \
| jq '.paths."/transit/keys/{name}".get.responses'
{ "200": { "description": "OK" } }
Why this matters
We depend on latest_version to detect Transit key rotation. Because it is undocumented, a reviewer questioned whether we should rely on it, and suggested deriving the current version from the largest key of the keys map instead.
We would prefer the scalar. The keys map returns version numbers as JSON object keys, so they must be parsed from strings before comparison, and its value shape appears to vary by key type. A documented scalar is easier to depend on.
Requests
- Please document
latest_version on the Read Key page, including in the sample response.
- Is
latest_version guaranteed present for all key types, and always >= 1 for a key that exists? We currently treat absence as an error and assume no lower bound — min_encryption_version is documented in the same response as using 0 as a sentinel for "use the latest version", so we did not want to assume 0 is impossible here without confirmation.
- Are response schemas for the Transit endpoints planned for the generated OpenAPI spec? That would resolve this class of question generally.
Vault version
Vault v2.0.4 (c9e9d1d4ddd4b55aae79a8949adffa9e96338720), built 2026-08-03T16:14:36Z
Describe the bug
GET /v1/transit/keys/:namereturns alatest_versionfield, but it is not documented anywhere:/v1/sys/internal/specs/openapihas no response body definition for this endpoint — the200is a bare"description": "OK"with no schema reference.The field is only discoverable by calling the endpoint.
Steps to reproduce
Against
hashicorp/vault:2.0.4in dev mode, withtransitenabled:Confirming the spec describes no response fields:
Why this matters
We depend on
latest_versionto detect Transit key rotation. Because it is undocumented, a reviewer questioned whether we should rely on it, and suggested deriving the current version from the largest key of thekeysmap instead.We would prefer the scalar. The
keysmap returns version numbers as JSON object keys, so they must be parsed from strings before comparison, and its value shape appears to vary by key type. A documented scalar is easier to depend on.Requests
latest_versionon the Read Key page, including in the sample response.latest_versionguaranteed present for all key types, and always>= 1for a key that exists? We currently treat absence as an error and assume no lower bound —min_encryption_versionis documented in the same response as using0as a sentinel for "use the latest version", so we did not want to assume0is impossible here without confirmation.Vault version