ProfessionalWiki / WikibaseEdtf

Wikibase extension that adds support for the Extended Date/Time Format (EDTF) via a new data type
https://wikibase.consulting/wikibase-edtf
GNU General Public License v2.0
7 stars 6 forks source link

What happens when you use the API to set a non-validating EDTF string #9

Closed mzeinstra closed 3 years ago

mzeinstra commented 3 years ago

For the documentation it would be good to know whether the string set not via the GUI will throw an error or will be imported regardless.

How does this currently work?

JeroenDeDauw commented 3 years ago

It will throw an error. The GUI uses the API. If you know how to use the browser console, you can open its network tab and then do an edit via the wikibase UI, possibly with an invalid EDTF value, and see the resulting API response.

mzeinstra commented 3 years ago

For documentation purposes the API returns this with an invalid date:

{
  "errors": [
    {
      "code": "modification-failed",
      "data": {
        "messages": [
          {
            "name": "wikibase-validator-invalid",
            "parameters": [],
            "html": {
              "*": "Invalid value"
            }
          }
        ]
      },
      "module": "main",
      "*": "Invalid value"
    }
  ],
}