Repository navigation
AC Typed Schema files invalid against JSON Schemas (and more errors) #8943
Replies: 10 comments
|
Following up, I've noticed some of the sample AdaptiveCards are also not valid, for example: https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.0/Elements/Container.Style.json This one contains a Another example is: https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.1/Tests/Image.Stretch.json Which has a |
|
I ran your own tests in Some are reported as "correctly invalid" as the test is asserting that these are invalid as expected, but the ones marked as INVALID are actual failing tests. I guess these tests just aren't run any more. Unfortunately it doesn't give a great impression to someone new coming to the repo to find the tests are broken, the schemas are out of date, the samples are incorrect. I was planning on replicating your test suite to validate my parser, using your |
|
Ok, relying on validating the samples against the AdaptiveCards schema to determine if I should be able to parse them doesn't work either, due to errors in the current live schema. In the current schema here: https://adaptivecards.io/schemas/adaptive-card.json Both This property should be Meanwhile |
|
In the current live schema ChoiceInputStyle is defined as: But it should also allow "filtered" since version 1.5: ChoiceInputStyle.json: This causes |
|
The final thing that tripped me up was that ... doesn't seem to validate as a However, after fixing the above issues locally I seem to be able to parse all the tests and samples which validate against your (fixed) schema, and I fail to parse all the ones that fail validation 🎉 |
|
I tried to run With the following fixed I can successfully generate rust types for this schema. 1Current value is 2The 3Currently this is defined as: But judging by the samples it should actually be: |
|
The Which is required to make it validate a host config. With that in many (all) of the host config samples fail validation because the casing is incorrect on many enum values. After fixing the casing the sample will pass, but only because the schema doesn't specify for any definition: Once you start adding those in you get more failures, as it looks like the host config schema hasn't been kept up to date with the samples or what is allowed in a host config. |
|
A different type of error not caught due to missing In the This is also an error in |
|
Just to chime in here, I think the AdaptiveCard schema is invalid as well. The James Thurley (@jamesthurley) has anyone acknowledged this is an issue? |
|
Chris W (@cwacek) No, not heard anything yet. Perhaps these discussions aren't monitored by anyone. My current plan is to loop back in 6 months, when I'll have a bit more spare time, and submit some PRs. I'd do it sooner but the repo looks quite complicated with a bunch of code generation and tooling in various languages, and I want to take the time to make sure I understand it all. In the mean time I'm just working off fixed up local copies of the files I need. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
For example this file:
https://github.com/microsoft/AdaptiveCards/blob/main/schemas/src/enums/ImageSize.json
Says it uses this schema:
https://raw.githubusercontent.com/microsoft/AdaptiveCards/6f39aedce45864ae1067ed44a5551dc973790bb5/source/nodejs/typed-schema/schema/lib/Type.json
But it isn't valid against that schema. It contains an extra
descriptionproperty, and is missing thetypeproperty. Have the schemas for theac-typed-schemaJSON been abandoned? Would a PR to update them be appreciated?All reactions