-
Notifications
You must be signed in to change notification settings - Fork 53
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
Schema validation fails for declarations omitting "template" since v3.20 #317
Comments
Added to the internal product backlog as AUTOTOOL-1776. |
That is strange. The fix should have been available in 3.22.0. Is it possible that VS Code has the old schema still cached? You could confirm that you are using the latest schema by trying to set the schemaVersion property to "3.22.0". |
@dstokesf5 setting the |
Sorry for being unclear. I was not expecting changing the schemaVersion to fix the problem, I was suggesting it as a diagnostic step. If VS Code gave an error for a value of "3.22.0", then that would suggest that it is using an outdated schema. It sounds like that is not the case. Marking as "untriaged" to take another look at this issue. |
it appears we had an issue with the 3.22.0 release, and a couple of bug fixes (including this one), are missing from the release. We are working to resolve this issue, and should have an update early next week. |
This issue should be resolved in the 3.22.1 release. |
Environment
Summary
Since AS3.20 the
template
property is optional and defaults togeneric
.This seems to break JSON Schema validation for multiple validation implementations.
Details
The
template
property in the AS3 Schema references adefault
ofgeneric
:f5-appsvcs-extension/schema/3.21.0/as3-schema.json
Lines 5763 to 5768 in 3e93ab8
When a JSON Schema (draft7) validator tries to validate a declaration like the "quick start" declaration from the 3.21 docs, it seems to ignore the default and assume that the
template
property is either empty or unspecified.This leads to a validation error as the tested JSON Schema validators due to the
allOf
keyword trying to applyif
conditions based on the value of thetemplate
property (which either seems to not exist or is empty).f5-appsvcs-extension/schema/3.21.0/as3-schema.json
Line 5880 in 3e93ab8
The validation failure for the different implementations differ.
Steps To Reproduce
Steps to reproduce the behavior:
Save "quick start" declaration from the 3.21 docs to
$PWD/quick_start.json
:Run https://github.com/simonkowallik/as3ninja (from docker for example):
docker run -it --rm \ -v $PWD/quick_start.json:/as3.json \ simonkowallik/as3ninja:latest \ as3ninja validate -d /as3.json -v 3.21.0
In this repro the python jsonschema library uses the first Schema $ref (Template_https) to validate the application
A1
, which fails due to the requirement ofserviceMain
.https://www.jsonschemavalidator.net/ fails as well, as does
ajv
(tested with as3_schema_validator)Expected Behavior
Schema validation does not fail.
Possible solution
I couldn't find what the expected behavior of a
if
condition against a non-existing property should be in the JSON Schema spec.But specifically testing if
"template": "generic"
does NOT exist seems to work:replacing
"allOf": [ .. ]
with the existing definition (and probably remove theif/then
forgeneric
):f5-appsvcs-extension/schema/3.21.0/as3-schema.json
Line 5880 in 3e93ab8
The text was updated successfully, but these errors were encountered: