diff --git a/pydatajson/schemas/dataset.json b/pydatajson/schemas/dataset.json index fa543ad..1903a6c 100644 --- a/pydatajson/schemas/dataset.json +++ b/pydatajson/schemas/dataset.json @@ -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": { diff --git a/tests/samples/several_assorted_errors.json b/tests/samples/several_assorted_errors.json index 508bae5..1a4bb89 100644 --- a/tests/samples/several_assorted_errors.json +++ b/tests/samples/several_assorted_errors.json @@ -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", diff --git a/tests/test_core.py b/tests/test_core.py index 6dcfc0b..b9a2632 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -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"),