From 86e3101d8cb171829df06e31a3943de8affed083 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 8 Jan 2020 09:31:10 +0200 Subject: [PATCH 1/2] Add quoted examples tests --- manifest.json | 6 +++++ .../invalid-quoted-array.raml | 27 +++++++++++++++++++ .../invalid-quoted-boolean.raml | 27 +++++++++++++++++++ .../invalid-quoted-integer.raml | 27 +++++++++++++++++++ .../invalid-quoted-nil.raml | 27 +++++++++++++++++++ .../invalid-quoted-number.raml | 27 +++++++++++++++++++ .../Types/quoted-examples-values/valid.raml | 27 +++++++++++++++++++ 7 files changed, 168 insertions(+) create mode 100644 tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml create mode 100644 tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml create mode 100644 tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml create mode 100644 tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml create mode 100644 tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml create mode 100644 tests/raml-1.0/Types/quoted-examples-values/valid.raml diff --git a/manifest.json b/manifest.json index 3ab8d424..ecb73df1 100644 --- a/manifest.json +++ b/manifest.json @@ -114,6 +114,12 @@ "tests/raml-1.0/Types/recurrent-definition/valid.raml", "tests/raml-1.0/Types/recurrent-array-definition/invalid.raml", "tests/raml-1.0/Types/recurrent-array-definition/valid.raml", + "tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml", + "tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml", + "tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml", + "tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml", + "tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml", + "tests/raml-1.0/Types/quoted-examples-values/valid.raml", "tests/raml-1.0/Types/property-array-of-scalars/invalid-array-item-type.raml", "tests/raml-1.0/Types/property-array-of-scalars/valid.raml", "tests/raml-1.0/Types/property-array-of-datatypes/invalid-array-item-type.raml", diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml new file mode 100644 index 00000000..81268107 --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: "[1, 2, 3]" + three: 18.2 + four: 19 + five: true + six: null + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml new file mode 100644 index 00000000..91cb580b --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: [1, 2, 3] + three: 18.2 + four: 19 + five: "true" + six: null + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml new file mode 100644 index 00000000..02e46642 --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: [1, 2, 3] + three: 18.2 + four: "19" + five: true + six: null + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml new file mode 100644 index 00000000..8c5e562a --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: [1, 2, 3] + three: 18.2 + four: 19 + five: true + six: "null" + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml new file mode 100644 index 00000000..9caa3701 --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: [1, 2, 3] + three: "18.2" + four: 19 + five: true + six: null + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing diff --git a/tests/raml-1.0/Types/quoted-examples-values/valid.raml b/tests/raml-1.0/Types/quoted-examples-values/valid.raml new file mode 100644 index 00000000..4f0ccb5e --- /dev/null +++ b/tests/raml-1.0/Types/quoted-examples-values/valid.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 +title: API with Types +types: + Thing: + type: object + properties: + one: any + two: array + three: number + four: integer + five: boolean + six: nil + example: + one: "hi" + two: [1, 2, 3] + three: 18.2 + four: 19 + five: true + six: null + +/things/{id}: + get: + responses: + 200: + body: + application/json: + type: Thing From 31ec0b5bd7ff768b2c5583a8642d128d0bfa6276 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 3 Sep 2020 09:46:02 +0300 Subject: [PATCH 2/2] Simplify quoted values tests --- .../invalid-quoted-array.raml | 14 ++------------ .../invalid-quoted-boolean.raml | 14 ++------------ .../invalid-quoted-integer.raml | 14 ++------------ .../quoted-examples-values/invalid-quoted-nil.raml | 14 ++------------ .../invalid-quoted-number.raml | 14 ++------------ 5 files changed, 10 insertions(+), 60 deletions(-) diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml index 81268107..eaf1f820 100644 --- a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-array.raml @@ -4,19 +4,9 @@ types: Thing: type: object properties: - one: any - two: array - three: number - four: integer - five: boolean - six: nil + test: array example: - one: "hi" - two: "[1, 2, 3]" - three: 18.2 - four: 19 - five: true - six: null + test: "[1, 2, 3]" /things/{id}: get: diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml index 91cb580b..d81b90c1 100644 --- a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-boolean.raml @@ -4,19 +4,9 @@ types: Thing: type: object properties: - one: any - two: array - three: number - four: integer - five: boolean - six: nil + test: boolean example: - one: "hi" - two: [1, 2, 3] - three: 18.2 - four: 19 - five: "true" - six: null + test: "true" /things/{id}: get: diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml index 02e46642..2c9603ab 100644 --- a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-integer.raml @@ -4,19 +4,9 @@ types: Thing: type: object properties: - one: any - two: array - three: number - four: integer - five: boolean - six: nil + test: integer example: - one: "hi" - two: [1, 2, 3] - three: 18.2 - four: "19" - five: true - six: null + test: "19" /things/{id}: get: diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml index 8c5e562a..d6d79f73 100644 --- a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-nil.raml @@ -4,19 +4,9 @@ types: Thing: type: object properties: - one: any - two: array - three: number - four: integer - five: boolean - six: nil + test: nil example: - one: "hi" - two: [1, 2, 3] - three: 18.2 - four: 19 - five: true - six: "null" + test: "null" /things/{id}: get: diff --git a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml index 9caa3701..7ae3f1a7 100644 --- a/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml +++ b/tests/raml-1.0/Types/quoted-examples-values/invalid-quoted-number.raml @@ -4,19 +4,9 @@ types: Thing: type: object properties: - one: any - two: array - three: number - four: integer - five: boolean - six: nil + test: number example: - one: "hi" - two: [1, 2, 3] - three: "18.2" - four: 19 - five: true - six: null + test: "18.2" /things/{id}: get: