From e18f4e67243c594f90ff7c2b13eff9a311128e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20Tru=CC=88eb?= Date: Fri, 20 Sep 2019 10:43:39 +0200 Subject: [PATCH 1/2] Add restriction on image MIME types for both pictures and logo. --- schema/schema.xsd | 18 +++++++++++-- scripts/tests/Schema_should.cs | 4 +++ .../should-fail/image-mimeType-invalid.xml | 27 +++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 scripts/tests/should-fail/image-mimeType-invalid.xml diff --git a/schema/schema.xsd b/schema/schema.xsd index 80695a3..247ae44 100644 --- a/schema/schema.xsd +++ b/schema/schema.xsd @@ -1429,7 +1429,14 @@ - + + + + + + + + @@ -1440,7 +1447,14 @@ - + + + + + + + + diff --git a/scripts/tests/Schema_should.cs b/scripts/tests/Schema_should.cs index 0b5e591..3baf018 100644 --- a/scripts/tests/Schema_should.cs +++ b/scripts/tests/Schema_should.cs @@ -87,6 +87,10 @@ public void should_fail() @"utilizations-empty.xml", 1, "The element 'utilizations' has incomplete content." ); + this.validate( + @"image-mimeType-invalid.xml", 2, + "The 'mimeType' element is invalid - The value 'image/svg+xml' is invalid according to its datatype 'String' - The Enumeration constraint failed." + ); } #region validate diff --git a/scripts/tests/should-fail/image-mimeType-invalid.xml b/scripts/tests/should-fail/image-mimeType-invalid.xml new file mode 100644 index 0000000..cb0db3f --- /dev/null +++ b/scripts/tests/should-fail/image-mimeType-invalid.xml @@ -0,0 +1,27 @@ + + + + + LA-644238 + active + rent + + + Calm and beautiful flat + + + http://www.someorg.com/dg546jdl + The living room + The living is very nice + image/svg+xml + + + http://www.someorg.com/dg546jdl + image/ico + + + + + + + From fbe541e3d84c96a900393da8aa190666d25fe146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20Tru=CC=88eb?= Date: Fri, 20 Sep 2019 10:47:39 +0200 Subject: [PATCH 2/2] Bump major version since this is a breaking retro-compatibility change. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 312e3c8..443ef41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "swissrets", - "version": "2.0.0", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1bd3a6b..610cc95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swissrets", - "version": "2.0.0", + "version": "3.0.0", "description": "A swiss real estate transfer standard.", "directories": { "doc": "docs"