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

Better error messages for schema validation #16097

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PollRobots
Copy link
Contributor

Description

This adds more informative error messages for some common schema validation errors.

This detects capitalization errors and small edit distance errors in attribute names and adjusts the error messages accordingly. If there is no close match to an attribute name, then the valid attribute names at that node in the schema are listed

Examples:

  • {"Name": "project"... -> project is missing a 'name' attribute, found 'Name' instead
  • ..."rutnime": "test"... -> project is missing a 'runtime' attribute, found 'rutnime'. instead
  • ..."template": {"displayNameDisplayName": "foo"... -> 'displayNameDisplayName' not allowed, the expected attributes are 'config', 'description', 'displayName', 'important', 'metadata' and 'quickstart'

Fixes # (issue)

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@PollRobots PollRobots requested a review from a team as a code owner May 1, 2024 00:25
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2024-05-01)

Features

  • [sdk/go] Make project validation error messages more helpful.
    #16097

@PollRobots PollRobots requested a review from Zaid-Ajaj May 1, 2024 19:57
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.

None yet

2 participants