Skip to content

Commit

Permalink
Agrego largo máximo a la validación de título de dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
lrromero committed Feb 19, 2018
1 parent 1d2c2e8 commit 50204f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pydatajson/schemas/dataset.json
Expand Up @@ -32,7 +32,12 @@
"type": "array",
"items": { "$ref": "distribution.json" }
},
"title": { "$ref": "mixed-types.json#nonEmptyString" },
"title": {
"allOf": [
{ "$ref": "mixed-types.json#nonEmptyString"},
{ "maxLength" : 100}
]
},
"description": { "$ref": "mixed-types.json#nonEmptyString" },
"issued": { "$ref": "mixed-types.json#dateOrDatetimeString" },
"superTheme": {
Expand Down
2 changes: 1 addition & 1 deletion tests/samples/several_assorted_errors.json
Expand Up @@ -48,7 +48,7 @@
"spatial": "ARG",
"dataset": [
{
"title": "Sistema de contrataciones electrónicas",
"title": "titletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitletitle",
"description": "Datos correspondientes al Sistema de Contrataciones Electrónicas (Argentina Compra)",
"publisher": {
"name": "Ministerio de Modernización. Secretaría de Modernización Administrativa. Oficina Nacional de Contrataciones",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_core.py
Expand Up @@ -127,6 +127,10 @@ def test_several_assorted_errors(self):
['error', 'catalog', 'errors', ],
"%s is not valid under any of the given schemas" % jsonschema_str('datos.gob.ar')
),
(
['error', 'dataset', 0, 'errors', ],
"%s is too long" % jsonschema_str('title' * 25)
),
(
['error', 'dataset', 0, 'errors', ],
"123 is not valid under any of the given schemas"),
Expand Down

0 comments on commit 50204f9

Please sign in to comment.