This tool is intended to test your Wiremock stubs against an OpenAPI (v3) specification. This will check the following
Type of Check | Description |
---|---|
API Method | Ensure the mock is matching the API Verb provided |
URL Pattern Match | Ensure the mock will actually match the URL |
Parameters | Checks all required parameters are present and the object type is correct. Will also check optional parameters but will only produce a warning |
Response | Checks the response object and ensuring the types also match |
.Net CLI (Global)
dotnet tool install --global Wiremock.OpenAPIValidator
wiremockopenapi -o "C:/git/MyApi/OpenApi.yml" -w "C:/git/wiremock/stubs/mappings"
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Install Wiremock OpenAPI Validator Tool
run: dotnet tool install --global Wiremock.OpenAPIValidator
- name: Run Validator
run: |
wiremockopenapi -o "./openapi/openapi.yaml" -w "./wiremock/mappings"
-o, --openApiPath Required. File path to the Open API Spec
-w, --wiremockMappingsPath Required. File path to the stubs mappings folder
--help Display this help screen.
--version Display version information.