Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validate function on Admin struct #1

Closed
zbuchheit opened this issue Aug 9, 2024 · 4 comments
Closed

Fix validate function on Admin struct #1

zbuchheit opened this issue Aug 9, 2024 · 4 comments

Comments

@zbuchheit
Copy link

zbuchheit commented Aug 9, 2024

Currently there is a validate function on the Admin struct that checks to make sure email, firstname, and lastname are not null, but in the case of an org token is used instead of a user token those fields will actually be null.
Ref: https://github.com/tmunzer/mistapi-go/blame/3ef09e46e7c0416c876983be74a3295e39ead771/mistapi/models/admin.go#L154C35-L169C2

The resulting response from https://api.ac2.mist.com/api/v1/self with an org token is

{
    "name": "pulumi-test-token",
    "privileges": [
        {
            "scope": "org",
            "org_id": "redacted",
            "role": "admin",
            "name": "Test Org"
        }
    ]
}
@zbuchheit
Copy link
Author

related issue: Juniper/terraform-provider-mist#3

@zbuchheit
Copy link
Author

I made an attempt here zbuchheit@dcdbd73 let me know your thoughts and I will open a PR if you think it looks good

@tmunzer
Copy link
Owner

tmunzer commented Aug 10, 2024

Hi @zbuchheit ,

I updated the Openapi Specs to fix this issue and regenerated the SDK.
This issue should be fixed now.

Thanks

@zbuchheit
Copy link
Author

this does appear to be fixed in the newest release. Thanks for fixing it so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants