hashicorp / vault-client-go

HashiCorp Vault Go Client Library generated from OpenAPI spec.
Mozilla Public License 2.0
84 stars 17 forks source link

Unmarshaling error when calling PkiIssueWithRole #185

Closed erwinvaneyk closed 1 year ago

erwinvaneyk commented 1 year ago

Expected Behavior

I am expecting the call using the Go client to succeed, just like it does when calling the API directly. It looks like the SDK is out of sync with the openapi spec, or the openapi spec with the actual vault server implementation. Though I am running pretty much the latest version of both projects, if it is a version mismatch, I'd expect a support matrix on the README and/or an error saying so when calling the API.

Current Behavior

I can see the call succeed when debugging the request, but during the unmarshaling the following error pops up:

json: cannot unmarshal number into Go struct field PkiIssueWithRoleResponse.data.expiration of type string

Failure Information

Please include the version of Vault binary and the version of vault-client-go you're using. vault: 1.13.4 vault-client-go: 0.3.3

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. run vault, setup PKI engine, configure a role
  2. use the PkiIssueWithRole function in the SDK to try to issue a cert for a given role. ...

Additional Information

Additional information including exception details, stack trace, etc.

averche commented 1 year ago

Hi @erwinvaneyk, thanks for reporting this!

The fix should be fairly simple in the corresponding OpenAPI schema. I've put together a PR to address this in https://github.com/hashicorp/vault/pull/21449.

maxb commented 1 year ago

The fix has now made its way into this repository by way of #188, so this issue may now be closed.

averche commented 1 year ago

Closing the issue per above. This is currently working in main and will be included in the 0.4.0 release. Thanks again for the report!