22title : Complete Examples
33sidebar_position : 10
44---
5+ import {JsonDisplay , YamlDisplay } from " ../../../src/components/JsonYamlDisplay" ;
56import Tabs from ' @theme/Tabs' ;
67import TabItem from ' @theme/TabItem' ;
78
@@ -12,142 +13,69 @@ import TabItem from '@theme/TabItem';
1213
1314This example shows all available configuration options:
1415
15- <Tabs groupId = " complete_configuration" >
16-
17- <TabItem value = " specmatic-yaml" label = " specmatic.yaml" >
18-
19- ``` yaml
20- version : 2
21- contracts :
22- - git :
23- url : https://azure.com/XNSio/XNSIO/_git/petstore-contracts
24- branch : main
25- provides :
26- - com/petstore/store.yaml
27- consumes :
28- - com/petstore/payment.yaml
29-
30- auth :
31- bearer-file : central_repo_auth_token.txt
32-
33- pipeline :
34- provider : azure
35- organization : XNSio
36- project : XNSIO
37- definitionId : 4
38-
39- environments :
40- staging :
41- baseurls :
42- auth.spec : http://localhost:8080
43- variables :
44- username : jackie
45- password : PaSsWoRd
46-
47- hooks :
48- hook_name : command
49-
50- report :
51- formatters :
52- - type : text
53- layout : table
54- types :
55- APICoverage :
56- OpenAPI :
57- successCriteria :
58- minThresholdPercentage : 100
59- maxMissedEndpointsInSpec : 0
60- enforce : true
61- ` ` `
6216
63- </TabItem>
64-
65- <TabItem value="specmatic-json" label="specmatic.json">
66-
67- ` ` ` json
68- {
69- " version " : 2,
70- " contracts " : [
71- {
72- " git " : {
73- " url " : " https://azure.com/XNSio/XNSIO/_git/petstore-contracts" ,
74- " branch " : " main"
75- },
76- " provides " : [
77- " com/petstore/store.yaml"
78- ],
79- " consumes " : [
80- " com/petstore/payment.yaml"
81- ]
82- }
83- ],
84-
85- " auth " : {
86- " bearer-file " : " central_repo_auth_token.txt"
87- },
88-
89- " pipeline " : {
90- " provider " : " azure" ,
91- " organization " : " XNSio" ,
92- " project " : " XNSIO" ,
93- " definitionId " : 4
94- },
95-
96- " environments " : {
97- " staging " : {
98- " baseurls " : {
99- " auth.spec " : " http://localhost:8080"
100- },
101- " variables " : {
102- " username " : " jackie" ,
103- " password " : " PaSsWoRd"
104- }
105- }
106- },
107-
108- " hooks " : {
109- " hook_name " : " command"
110- },
111-
112- " report " : {
113- " formatters " : [
114- {
115- " type " : " text" ,
116- " layout " : " table"
117- }
118- ],
119- " types " : {
120- " APICoverage " : {
121- " OpenAPI " : {
122- " successCriteria " : {
123- " minThresholdPercentage " : 100,
124- " maxMissedEndpointsInSpec " : 0,
125- " enforce " : true
126- }
127- }
128- }
129- }
130- }
131- }
132- ```
17+ <Tabs groupId = { ` tab-complete-examples ` } >
18+ <TabItem value = " v3" label = " Version 3 (recommended)" >
19+ <Tabs groupId = " v3-tabs" >
20+ <TabItem value = { ` specmatic-yaml-v3-complete-examples ` } label = " specmatic.yaml" >
21+ <YamlDisplay object = { require (' ./includes/complete-examples/v3/specmatic.json' )} />
22+ </TabItem >
23+ <TabItem value = { ` specmatic-json-v3-complete-examples ` } label = " specmatic.json" >
24+ <JsonDisplay object = { require (' ./includes/complete-examples/v3/specmatic.json' )} />
25+ </TabItem >
26+ </Tabs >
27+
28+ ** Configuration Structure Summary (v3)**
29+
30+ The complete configuration file supports the following top-level sections:
31+
32+ 1 . ** version** - Configuration version number (latest being ` 3 ` ).
33+ 2 . ** components** - Reusable components and definitions. Key sub-sections include:
34+ - ` components.sources ` - Define contract sources (Git repositories or filesystem locations) used to load API specs.
35+ - ` components.services ` - Service definitions referenced by ` systemUnderTest ` and ` dependencies ` . Each service
36+ typically contains ` definitions ` which reference a ` source ` and one or more ` specs ` .
37+ - ` components.runOptions ` - Named run configurations (for example, ` openapi.type ` = ` test ` or ` mock ` , and ` baseUrl ` )
38+ - ` components.adapters ` - Adapter definitions for massaging contract specifications, or for mutating request/responses
39+ from the proxy and/or stub.
40+ 3 . ** systemUnderTest** - Defines the primary system under test. Contains a ` components.service ` entry and
41+ usually an associated ` runOptions ` profile for executing contract tests.
42+ 4 . ** dependencies** - Defines dependent services used for service virtualization. Typically contains a ` services `
43+ array where each item references a ` components.services ` entry and optional ` runOptions ` (often used to point to
44+ mock instances).
45+ 5 . ** specmatic** - Specmatic-specific configuration:
46+ - ` specmatic.settings ` - Runtime and backward-compatibility settings (mock/test options, strictMode, baseBranch,
47+ delays, timeouts, etc.).
48+ - ` specmatic.governance ` - Reporting and success criteria (formats, outputDirectory, enforcement thresholds).
49+ - ` specmatic.license ` - License path or configuration.
50+
51+ For detailed information on each section, refer to the linked documentation pages.
13352
13453 </TabItem >
54+ <TabItem value = " v2" label = " Version 2" >
55+ <Tabs groupId = " v2-tabs" >
56+ <TabItem value = { ` specmatic-yaml-v2-complete-examples ` } label = " specmatic.yaml" >
57+ <YamlDisplay object = { require (' ./includes/complete-examples/v2/specmatic.json' )} />
58+ </TabItem >
13559
136- </Tabs >
60+ <TabItem value = { ` specmatic-json-v2-complete-examples ` } label = " specmatic.json" >
61+ <JsonDisplay object = { require (' ./includes/complete-examples/v2/specmatic.json' )} />
62+ </TabItem >
63+ </Tabs >
13764
138- ## Configuration Structure Summary
65+ ** Configuration Structure Summary (v2) **
13966
140- The complete configuration file supports the following top-level sections:
67+ The complete configuration file supports the following top-level sections:
14168
142- 1 . ** version** - Configuration version number (currently 2)
143- 2 . ** contracts** - Define API specifications from Git or filesystem
144- 3 . ** auth** - Authentication configuration for source control
145- 4 . ** pipeline** - CI/CD pipeline integration settings
146- 5 . ** environments** - Environment-specific variables and base URLs
147- 6 . ** hooks** - Custom commands for contract processing
148- 7 . ** test** - Contract testing configuration
149- 8 . ** stub** - Service virtualization configuration
150- 9 . ** report** - Report generation and formatting options
151- 10 . ** examples** - Directories for externalized examples
69+ 1 . ** version** - Configuration version number (latest being ` 3 ` )
70+ 2 . [ ` contracts ` ] ( /references/configuration/contract-management ) - Define API specifications from Git or filesystem
71+ 3 . [ ` hooks ` ] ( /references/configuration/hooks ) - Custom commands for contract processing
72+ 4 . [ ` test ` ] ( /references/configuration/test-configuration ) - Contract testing configuration
73+ 5 . [ ` mock ` ] ( /references/configuration/mock-configuration ) - Service virtualization configuration
74+ 6 . [ ` report ` ] ( /references/configuration/reports ) - Report generation and formatting options
75+ 7 . [ ` examples ` ] ( /references/configuration/mock-configuration#externalized-examples-directories ) - Directories for
76+ externalized examples
15277
153- For detailed information on each section, refer to the specific documentation pages.
78+ For detailed information on each section, refer to the specific documentation pages.
79+
80+ </TabItem >
81+ </Tabs >
0 commit comments