-
Notifications
You must be signed in to change notification settings - Fork 595
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
3.0.0-rc0: strange schema for FoldTransform.as #4105
Comments
Also, I'm not certain what vega-lite version the currently-live docs refer to, but the described syntax of the fold transform there does not match the schema: https://vega.github.io/vega/docs/transforms/fold/ |
Here is the type in Typescript: https://github.com/vega/vega-typings/blob/e22ed3faa7dc7e9bba5607c249f526f98de23436/types/spec/transform.d.ts#L186 The type is a bit odd but not wrong. It says that we want an array with at least two items and the items should be strings. Any additional item should also be a string. We can try to make the schema more strict. |
Agree that it's technically correct but a bit odd. What caught me off-guard is the use of an array of schemas for items. It's currently the only place in the vega-lite schema that that is used, and the fact that it led to such a strange schema made me wonder if the schema building tool was not handling it properly. |
Maybe changing Edit: or perhaps
This seems to work properly elsewhere in the typing specification. |
I'll look into it over at vega/ts-json-schema-generator#40. |
The typings now come from Vega-Typings and it would be nice to keep the strict TS typings. |
This is a bit inaccurate. The type there means there should b _strictly two items, and each of them should be a string. |
The schema type is less strict and just says what I wrote. Your description is for the TS type. |
I see. Sounds like a bug that |
It's not wrong, just imprecise. |
Fixed in #4107 |
Thanks! |
The schema definition for
FoldTransform.as
is a bit strange. It's supposed to be a two-element array, correct? So what is the purpose ofadditionalItems: anyOf: ["string", "string"]
?I'm wondering if this is indicative of some mis-specification in the typescript.
The text was updated successfully, but these errors were encountered: