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

GH-660: Prevent empty mobile block on client resource #742

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions internal/auth0/client/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,12 @@ func NewResource() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"android": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Configuration settings for Android native apps.",
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Configuration settings for Android native apps.",
AtLeastOneOf: []string{"mobile.0.ios"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "mobile.0.android"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, when using AtLeastOneOf the current resource attribute is already included.

Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"app_package_name": {
Expand All @@ -283,11 +284,12 @@ func NewResource() *schema.Resource {
},
},
"ios": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Configuration settings for i0S native apps.",
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Configuration settings for i0S native apps.",
AtLeastOneOf: []string{"mobile.0.android"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "mobile.0.ios"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, when using AtLeastOneOf the current resource attribute is already included.

Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"team_id": {
Expand Down