Skip to content

Commit e75c9d0

Browse files
Add support for strict mode in Specmatic configuration (SchemaStore#5137)
* Add support for strict mode 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 ccc76bb commit e75c9d0

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"contracts": [],
3+
"stub": {
4+
"strictMode": "enabled"
5+
},
6+
"version": 2
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"contracts": [],
3+
"test": {
4+
"strictMode": "enabled"
5+
},
6+
"version": 2
7+
}

src/schemas/json/specmatic.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@
458458
"timeoutInMilliseconds": {
459459
"type": ["integer", "null"],
460460
"description": "Test timeout in milliseconds"
461+
},
462+
"strictMode": {
463+
"type": ["boolean", "null"],
464+
"description": "Whether to enable strict mode for contract testing"
461465
}
462466
}
463467
},
@@ -501,6 +505,10 @@
501505
"hotReload": {
502506
"type": ["string", "null"],
503507
"description": "Hot reload configuration"
508+
},
509+
"strictMode": {
510+
"type": ["boolean", "null"],
511+
"description": "Whether to enable strict mode for stubbing"
504512
}
505513
}
506514
},

src/test/specmatic/specmatic.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@
140140
"generative": true,
141141
"hotReload": "enabled",
142142
"includeMandatoryAndRequestedKeysInResponse": true,
143-
"startTimeoutInMilliseconds": 10000
143+
"startTimeoutInMilliseconds": 10000,
144+
"strictMode": true
144145
},
145146
"test": {
146147
"allowExtensibleSchema": false,
147148
"resiliencyTests": {
148149
"enable": "all"
149150
},
151+
"strictMode": false,
150152
"timeoutInMilliseconds": 30000,
151153
"validateResponseValues": true
152154
},

0 commit comments

Comments
 (0)