-
Notifications
You must be signed in to change notification settings - Fork 5
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
Azure pipelines invalid escape #328
Comments
It is an error thrown by ajv trying to load the schema. This can be reproduced independently of v8r, just using ajv-cli:
It is hitting the error on this line of the schema https://github.com/microsoft/azure-pipelines-vscode/blob/97f39ff988232860b35556dde725d448151ec5a0/service-schema.json#L1076 I'm not sure if its an issue with the schema itself or AJV. |
Created an issue: ajv-validator/ajv#2296 |
I was working on something else recently that made me realise what is going on here. AJV constructs regular expressions with the unicode In javascript, Unnecessary escape sequences are invalid with the So this var regex = new RegExp("^[^\\/~\\^\\: \\[\\]\\\\]+(\\/[^\\/~\\^\\: \\[\\]\\\\]+)*$", "u") throws a
I guess the reason this schema works with some validators is that maybe there are some JSON schema tools that either don't construct with the unicode flag, or this constraint (no unnecessary escape sequences when using unicode) is not there in other regexp engines. I've not really dug into it. Note that var regex = new RegExp("^[^\\/~\\^\\: \\[\\]\\\\]+(\\/[^\\/~\\^\\: \\[\\]\\\\]+)*$") constructs a regex without error. I think the solution to this - if you wanted to submit a PR upstream to https://github.com/microsoft/azure-pipelines-vscode/ - would be to remove the unnecessary escapes on the var regex = new RegExp("^[^\\/~\\^: \\[\\]\\\\]+(\\/[^\\/~\\^: \\[\\]\\\\]+)*$", "u") is valid with the unicode flag. |
@chris48s I don't understand what is going on, I don't know if the error is in my file or in the schema itself (the url you mention).
My azure-pipelines.yml file should not be because it validates and runs correctly in Azure DevOps.
The text was updated successfully, but these errors were encountered: