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

Improve member not targeting a property error message to better hint at fix #1501

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

DavidOgunsAWS
Copy link
Contributor

Issue #, if available:
When a resource properties block is present in a resource shape, all members of instance operations must be an identifier, property, or somehow marked as @notProperty. Implicit identifier bindings are formed through indirect requirements (name, target shape match, required) but the modeler may miss any of them -- likely the @required trait, especially when using target elision syntax. The validator for properties uses the identifier binding index as a filter, however this binding index won't see an intended ID as such if it's missing the @required trait as clearly as the modeler does and leads to an error message that may be confusing in isolation. This change attempts to orient a modeler correctly to more correctly understand what possible mistakes were made.

Note: given the scenario mentioned, core validation will also produce another error at the same time:

[ERROR] ... This operation does not form a valid instance operation when bound to resource `...`. All of the identifiers of the resource were not implicitly or explicitly bound to the input of the operation. Expected the following identifier bindings: [required member named `...` that targets `...`]

Whether the intend for the member to be an identifier or property, or neither at all is ambiguous. Elision syntax makes it clear to the modeler, but the validator has no visibility there. A further improvement might be to suppress the property error if the identifier error is observed.

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@DavidOgunsAWS DavidOgunsAWS requested a review from a team as a code owner November 17, 2022 17:12
@DavidOgunsAWS DavidOgunsAWS changed the title Improving error message to better hint at remedial action. Improve member not targeting a property error message to better hint at remedial action. Nov 17, 2022
@DavidOgunsAWS DavidOgunsAWS changed the title Improve member not targeting a property error message to better hint at remedial action. Improve member not targeting a property error message to better hint at fix Nov 21, 2022
@mtdowling mtdowling merged commit eb23b58 into main Nov 29, 2022
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

Successfully merging this pull request may close these issues.

3 participants