Skip to content

Commit 6794b6c

Browse files
Update the json schema for 'contracts' key in Specmatic Configuration Schema (SchemaStore#5041)
* Add Specmatic configuration schema - Add JSON schema for Specmatic configuration files - Support for specmatic.json, specmatic.yaml, and specmatic.yml files - Includes comprehensive configuration validation for contract testing - Add test case with realistic configuration example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update the json schema for the 'contracts' key in specmatic configuration * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent db238bb commit 6794b6c

28 files changed

+356
-110
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"basePath": 123,
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"baseUrl": 123,
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"host": 123,
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"invalidProperty": "should-not-be-allowed",
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"port": "should-be-integer",
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"contracts": [
3+
{
4+
"consumes": [
5+
{
6+
"specs": "should-be-array"
7+
}
8+
]
9+
}
10+
],
11+
"version": "VERSION_2"
12+
}

src/negative_test/specmatic/contract-branch-wrong-type.json renamed to src/negative_test/specmatic/consumes-wrong-type.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"contracts": [
33
{
4-
"branch": 123,
5-
"provider": "git"
4+
"consumes": "not-an-array"
65
}
76
],
87
"version": "VERSION_2"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"contracts": [
3+
{
4+
"invalidProperty": "should-not-be-allowed",
5+
"provides": [
6+
{
7+
"specs": ["test.yaml"]
8+
}
9+
]
10+
}
11+
],
12+
"version": "VERSION_2"
13+
}

src/negative_test/specmatic/contract-invalid-provider.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/negative_test/specmatic/contract-missing-provider.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)