-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[cli] Improve validation error message for vercel.json #4694
Merged
kodiakhq
merged 14 commits into
master
from
ensure-good-looking-error-for-when-the-new-ch3114
Jun 22, 2020
Merged
[cli] Improve validation error message for vercel.json #4694
kodiakhq
merged 14 commits into
master
from
ensure-good-looking-error-for-when-the-new-ch3114
Jun 22, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
styfle
commented
Jun 22, 2020
TooTallNate
reviewed
Jun 22, 2020
TooTallNate
reviewed
Jun 22, 2020
TooTallNate
approved these changes
Jun 22, 2020
MaxLeiter
approved these changes
Jun 22, 2020
kodiakhq
bot
deleted the
ensure-good-looking-error-for-when-the-new-ch3114
branch
June 22, 2020 22:38
kodiakhq bot
pushed a commit
that referenced
this pull request
Jun 24, 2020
This PR is a follow up to #4694 so we can use this same helper function in the API. I tried to follow the existing error message format so that the API can use a different prefix than the CLI. The API currently returns a 400 with `Invalid request` when a Git deploy fails validation: ![api-comment](https://user-images.githubusercontent.com/229881/85466548-1c140b00-b578-11ea-9bed-1eb14df2685a.png)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the validation error message when the user has an invalid
vercel.json
file.Previously, the error message did not account for nested properties so
{"foo": "will error"}
looked fine because it would mention there is an additional propertyfoo
. However, the error message for{ "routes": [{ "foo": "will error" }] }
did not mention anything aboutroutes
when it explaining there was an additional propertyfoo
. This became more apparent as we added nested properties forrewrites
andredirects
(see tests in this PR).This PR also adds suggestions for common mistakes such as
src
vssource
.