Page MenuHomePhabricator

Create error identification and Z5 formatting in function-schemata php library
Closed, ResolvedPublic

Event Timeline

Change 710571 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/services/function-schemata@master] [WIP] Add error formatting to php validation

https://gerrit.wikimedia.org/r/710571

Showing multiple validation errors on one pass is sometimes not possible with the type of schema validation that we are doing.

In examples such as the one below, where there are two keys that are incorrect (Z2K1 and Z2K2), because the parser requires all of the keys (Z2K1, Z2K2 and Z2K3) to be correct, as soon as the first one is wrong, it stops matching against the schema and returns the validation errors found till then. This means that the opis/json-schema library cannot give us information about these two keys being wrong on a first parsing.

{
        "Z1K1": {
            "Z1K1": "Z9",
            "Z9K1": "Z2"
        },
        "Z2K1": {
            "Z1K1": "Z6",
            "Z6K1": false  // ERROR Z533 (Z6K1 must be a string)
        },
        "Z2K2": {
            "Z1K1": "Z6",
            "Z6K1": 5.6   // ERROR Z533 (Z6K1 must be a string)
        },
        "Z2K3": {
            "Z1K1": {
                "Z1K1": "Z9",
                "Z9K1": "Z12"
            },
            "Z12K1": {
                "Z1K1": {
                    "Z1K1": "Z9",
                    "Z9K1": "Z10"
                }
        }
}

Ah well, if we can't catch both then so be it.

Agree with James. I would say, it would be nice to list as many independent errors as possible in one go, but it is acceptable if only one is listed at a time in order to make the implementation simpler. It would be nice to add a "There might be more errors." message if that is the case, but also, not a requirement.

Change 712981 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Update extension and function-schemata version

https://gerrit.wikimedia.org/r/712981

Change 712981 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update extension and function-schemata version

https://gerrit.wikimedia.org/r/712981

Jdforrester-WMF changed the task status from Open to In Progress.Sep 15 2021, 7:18 PM

Change 724766 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Decouple validation and ZObject creation to use function-schemata validator

https://gerrit.wikimedia.org/r/724766

Change 727359 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/services/function-schemata@master] Return whole ValidationResult object to be used by WikiLambda

https://gerrit.wikimedia.org/r/727359

Change 727359 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] Return whole ValidationResult object to be used by WikiLambda

https://gerrit.wikimedia.org/r/727359

Change 730955 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (e134e54)

https://gerrit.wikimedia.org/r/730955

Change 731742 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (1451dc7)

https://gerrit.wikimedia.org/r/731742

Change 731743 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (1451dc7)

https://gerrit.wikimedia.org/r/731743

Change 730955 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (e134e54)

https://gerrit.wikimedia.org/r/730955

Change 731743 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (1451dc7)

https://gerrit.wikimedia.org/r/731743

Change 731742 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (1451dc7)

https://gerrit.wikimedia.org/r/731742

Change 724766 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Decouple validation and ZObject creation to use function-schemata validator

https://gerrit.wikimedia.org/r/724766