-
Notifications
You must be signed in to change notification settings - Fork 14
feat(onelake_shortcut): onboard new data-source and resource #424
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
base: main
Are you sure you want to change the base?
Conversation
Computed: true, | ||
}, | ||
}, | ||
"onelake": onelakeSchema(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move validations that only one is populated to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DariuszPorowski I'm trying to move a validation rule from the ConfigValidators section in resource_shortcut.go into the schema definition using objectvalidator.ExactlyOneOf. Specifically, I’ve replaced the original resourcevalidator.ExactlyOneOf(...) with this schema-level code:
Validators: []validator.Object{
objectvalidator.ExactlyOneOf(
path.MatchRelative().AtName("onelake"), //tried with matchRoot as it was in ConfigValidators too
path.MatchRelative().AtName("adls_gen2"),
path.MatchRelative().AtName("amazon_s3"),
...
),
},
I’ve seen similar usage with validators like RequireIfAttributeIsOneOf and NullIfAttributeIsOneOf, which work correctly inside the schema. However, after switching to objectvalidator.ExactlyOneOf, I'm seeing unexpected behavior during unit tests: the cases that previously passed using resourcevalidator.ExactlyOneOf now fail with the new schema validation.
I was wondering if we can even move this validation ConfigValidators to schema-level, and if so, any guidance on the correct usage or how to structure this validation inside the schema would be much appreciated. Thanks!
📥 Pull Request
❓ What are you trying to address
close #422
close #421
Onboard new onelake shortcut resource/data-source