Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

added grant_type support to client resource #22

Merged
merged 2 commits into from
Jul 6, 2018
Merged

added grant_type support to client resource #22

merged 2 commits into from
Jul 6, 2018

Conversation

domg123
Copy link
Contributor

@domg123 domg123 commented Jul 5, 2018

No description provided.

@domg123
Copy link
Contributor Author

domg123 commented Jul 5, 2018

Test failures are unrelated to my fix - test looked like it updated grant_types ok.

@alexkappa
Copy link
Owner

Hi @domg123, thanks for submitting this! Looking at the errors, it might be that d.Set("grant_types", c.GrantTypes) didn't work as expected.

This error message suggests that the grant_types are being set to an empty array after the value is being read back from Auth0:

grant_types.#: "4" => "0"

Sometimes the Auth0 API doesn't return all the values from a resource, unless you explicitly request them. We might need to update the Auth0 SDK for this to work.

@alexkappa
Copy link
Owner

alexkappa commented Jul 5, 2018

Ok. So I've pulled your branch to verify my hypothesis, but it turns out I was wrong :)

The solution was much easier, it was related to grant_types being defined as optional, but not as computed. In this case grant_types will be generated if none is set (by Auth0).

TLDR; we just need a Comuted: true to the schema and it should be good to go!

@domg123
Copy link
Contributor Author

domg123 commented Jul 5, 2018

Thanks for taking a look! I've added Computed.

@alexkappa alexkappa merged commit 2976be9 into alexkappa:master Jul 6, 2018
@alexkappa
Copy link
Owner

Thank you for contributing!

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

Successfully merging this pull request may close these issues.

3 participants