-
Notifications
You must be signed in to change notification settings - Fork 232
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
Relax validation of ID attribute #613
Conversation
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.
Conceptually looks good to me. 😄
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.
I'd be curious to see how this affects the schemas of top N providers - whether any of them would fail this validation and why.
I remember tweaking the internal validation in the past myself which brought many surprises and lead to some reverting later. 😅
I may have missed some recent updates around ID handling, but on what occasion would a resource want to make id
optional? I'm aware that id
has lost its special status in core, but aren't there still SDK parts which treat it as special? e.g. we haven't really gotten rid of ResourceData.Id()
or ResourceData.SetId()
- this was one of the reasons for the strict validation AFAICT. I guess it's fine if calling SetId(val)
& Set("id", val)
and Id()
& Get("id")
have the same implications? They don't seem to though.
The description use case makes sense to me though.
Resources IDs are currently optional, this is letting you turn it off. |
Ah, that's fair then 👍 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes #607
Currently in the
InternalValidate
validation, we prohibit any explicit overriding of theid
attribute for resources in favor of writing an explicit version. But this does not allow modifying theOptional
bit, or setting a customDescription
which is useful for docs generation and the language server. This allows implementers to override theid
if they so choose as long as it still adheres to the rules specified for the built-in usage.