Getting Started with Configuration

The Specmatic configuration file provides a centralized way to define how Specmatic should operate within your project. It allows you to declaratively specify the specifications to load, the test mode to run in, the stub settings, and other runtime options required by Specmatic.

Using this configuration file helps keep all Specmatic-related settings together so you don’t need to update multiple places when making changes. It simplifies setup, reduces repetition, and makes your Specmatic usage predictable and easy to understand—whether you are working with consumer tests, provider tests, or using Specmatic as a stub.

A Specmatic configuration typically enables you to configure:

  • Specifications to be used by Specmatic
  • Test modes such as resiliency testing or only positive testing, etc.
  • Stub ports and related options
  • Directories for examples and other supporting files
  • Flags such as response value validation and more

By consolidating these details into a dedicated configuration file, Specmatic allows your project to remain clean and organized while giving you full control over how contract tests and stubs behave.