- Issue created by @mogtofu33
- Assigned to pdureau
- Assigned to mogtofu33
- Status changed to Needs work
4 months ago 9:22am 4 September 2024 - 🇫🇷France pdureau Paris
Hi Jean,
I have added the JSON schema file: https://git.drupalcode.org/project/ui_icons/-/blob/cd3e748f361f4af084a53...
Some questions:
- Is it the good opportunity to add other metadata in the iconpack definition? Like
license
orlinks
? - I wanted to make
template
required, but I see some tests files are not using it. What is happening during rendering if we don't set a template? - In
settings
, the"^\\w+$"
pattern is accepting value with a dash ("-
"). But AFAIK Twig is not accepting variables with a-
. Do we change the pattern or do we keep the schema simple?
- Is it the good opportunity to add other metadata in the iconpack definition? Like
- 🇫🇷France mogtofu33
Thanks for the schema, so:
- why not, probably can have a `version` too.
- Then fallback to default template in IconDefinition
- Probably better to start simple
- Assigned to pdureau
- Assigned to mogtofu33
- Assigned to pdureau
- 🇫🇷France mogtofu33
I have a problem with some settings where errors can not be fixed, I guess it's from the yaml => php array => object conversion, but I cannot find a solution yet, problems can be seen when enabling `UI Icons Example` and in the `icon_pack_example_settings` definition:
icon_pack_example_settings: settings: select: title: "Test select" description: "Test for a select with enum property." type: "integer" enum: [100, 200, 300, 400, 500, 600, 700, 800, 900] default: 400
Problem with enum array.
TypeError: array_key_exists(): Argument #2 ($array) must be of type array, true given in array_key_exists() (line 92 of /var/www/html/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php).
icon_pack_example_settings: settings: decimal: title: "Test decimal" type: "number" default: 66.66 multipleOf: 0.01
Problem with `multipleOf` but cannot find how to fix it with `minimum`:
[settings.decimal.multipleOf] Use of exclusiveMinimum requires presence of minimum [settings.decimal] Failed to match all schemas
icon_pack_example_settings: settings: number: title: "Test number min/max/step" description: "Test for number with constraints." type: "integer" default: 30 minimum: 10 maximum: 100 multipleOf: 10
Same error:
[settings.number.multipleOf] Use of exclusiveMinimum requires presence of minimum [settings.number] Failed to match all schemas
- 🇫🇷France pdureau Paris
I have a problem with some settings where errors can not be fixed, I guess it's from the yaml => php array => object conversion, but I cannot find a solution yet,
We got similar issue with Dilla's discovery and UI Patterns 2.x, I will have a look.
[settings.decimal.multipleOf] Use of exclusiveMinimum requires presence of minimum [settings.decimal] Failed to match all schemas
Werid
- 🇫🇷France pdureau Paris
TODO: make the template property mandatory because 📌 [1.0.0-beta1] Remove IconDefinition::DEFAULT_TEMPLATE Active
- 🇫🇷France pdureau Paris
Many things to check.
First, some JSON schema stuff like
multipleOf
are problematic. Maybe we can change:"patternProperties": { "^\\w+$": { "$ref": "https://json-schema.org/draft/2020-12/schema" } },
SDC is using http://json-schema.org/draft-04/schema#
And also YAML to PHP array conversion?
Jean, can you start by rebasing?
-
mogtofu33 →
committed 859512a7 on 3466827-1.0.0-beta1-json-validation
Issue #3466827 by mogtofu33, pdureau: Json validation of Icon set...
-
mogtofu33 →
committed 859512a7 on 3466827-1.0.0-beta1-json-validation
-
mogtofu33 →
committed 9241b92a on 3466827-1.0.0-beta1-json-validation
Issue #3466827 by mogtofu33, pdureau: Json validation of Icon set...
-
mogtofu33 →
committed 9241b92a on 3466827-1.0.0-beta1-json-validation
- 🇫🇷France mogtofu33
Current fork was messy, moved as mr: https://git.drupalcode.org/project/ui_icons/-/merge_requests/41
-
mogtofu33 →
committed 2c716bf8 on 1.0.x
Issue #3466827 by mogtofu33, pdureau: Json validation of Icon set...
-
mogtofu33 →
committed 2c716bf8 on 1.0.x
Automatically closed - issue fixed for 2 weeks with no activity.