Complete Configuration Examples
Complete Sample Configuration with All Attributes
This example shows all available configuration options:
- specmatic.yaml
- specmatic.json
version: 2
contracts:
- git:
url: https://azure.com/XNSio/XNSIO/_git/petstore-contracts
branch: main
provides:
- com/petstore/store.yaml
consumes:
- com/petstore/payment.yaml
auth:
bearer-file: central_repo_auth_token.txt
pipeline:
provider: azure
organization: XNSio
project: XNSIO
definitionId: 4
environments:
staging:
baseurls:
auth.spec: http://localhost:8080
variables:
username: jackie
password: PaSsWoRd
hooks:
hook_name: command
report:
formatters:
- type: text
layout: table
types:
APICoverage:
OpenAPI:
successCriteria:
minThresholdPercentage: 100
maxMissedEndpointsInSpec: 0
enforce: true
{
"version": 2,
"contracts": [
{
"git": {
"url": "https://azure.com/XNSio/XNSIO/_git/petstore-contracts",
"branch": "main"
},
"provides": [
"com/petstore/store.yaml"
],
"consumes": [
"com/petstore/payment.yaml"
]
}
],
"auth": {
"bearer-file": "central_repo_auth_token.txt"
},
"pipeline": {
"provider": "azure",
"organization": "XNSio",
"project": "XNSIO",
"definitionId": 4
},
"environments": {
"staging": {
"baseurls": {
"auth.spec": "http://localhost:8080"
},
"variables": {
"username": "jackie",
"password": "PaSsWoRd"
}
}
},
"hooks": {
"hook_name": "command"
},
"report": {
"formatters": [
{
"type": "text",
"layout": "table"
}
],
"types": {
"APICoverage": {
"OpenAPI": {
"successCriteria": {
"minThresholdPercentage": 100,
"maxMissedEndpointsInSpec": 0,
"enforce": true
}
}
}
}
}
}
Configuration Structure Summary
The complete configuration file supports the following top-level sections:
- version - Configuration version number (currently 2)
- contracts - Define API specifications from Git or filesystem
- auth - Authentication configuration for source control
- pipeline - CI/CD pipeline integration settings
- environments - Environment-specific variables and base URLs
- hooks - Custom commands for contract processing
- test - Contract testing configuration
- stub - Service virtualization configuration
- report - Report generation and formatting options
- examples - Directories for externalized examples
For detailed information on each section, refer to the specific documentation pages.