Skip to content

Commit

Permalink
fix: change validation message
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Mar 20, 2023
1 parent be10344 commit 5c18008
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions node/validation/manifest/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,25 @@ ADDTIONAL PROPERTY must NOT have additional properties
exports[`route > should throw on invalid pattern 1`] = `
"Validation of Edge Functions manifest failed
FORMAT pattern needs to be a regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards
FORMAT pattern must be a regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$
10 | \\"name\\": \\"name\\",
11 | \\"function\\": \\"hello\\",
> 12 | \\"pattern\\": \\"/^/hello/?$/\\",
| ^^^^^^^^^^^^^^ 👈🏽 format pattern needs to be a regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards
| ^^^^^^^^^^^^^^ 👈🏽 format pattern must be a regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$
13 | \\"generator\\": \\"@netlify/fake-plugin@1.0.0\\"
14 | }
15 | ],"
`;
exports[`route > should throw on missing beginning slash with FF 1`] = `
"Validation of Edge Functions manifest failed
FORMAT pattern needs to be a regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards
FORMAT pattern must be a regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$
10 | \\"name\\": \\"name\\",
11 | \\"function\\": \\"hello\\",
> 12 | \\"pattern\\": \\"^hello/?$\\",
| ^^^^^^^^^^^ 👈🏽 format pattern needs to be a regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards
| ^^^^^^^^^^^ 👈🏽 format pattern must be a regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$
13 | \\"generator\\": \\"@netlify/fake-plugin@1.0.0\\"
14 | }
15 | ],"
Expand Down
5 changes: 2 additions & 3 deletions node/validation/manifest/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const routesSchema = {
pattern: {
type: 'string',
format: 'regexPattern',
errorMessage:
'pattern needs to be a regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards',
errorMessage: 'pattern must be a regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$',
},
generator: { type: 'string' },
},
Expand All @@ -35,7 +34,7 @@ const functionConfigSchema = {
type: 'string',
format: 'regexPattern',
errorMessage:
'excluded_patterns needs to be an array of regex that starts with ^ followed by / and ends with $ without any additional slashes before and afterwards',
'excluded_patterns must be an array of regex that starts with ^/ and ends with $ for example ^/blog/[d]{4}$',
},
},
on_error: { type: 'string' },
Expand Down

0 comments on commit 5c18008

Please sign in to comment.