Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tidusjar/wiremock.openapivalidator
Validate your Wiremock mappings against an OpenAPI spec
https://github.com/tidusjar/wiremock.openapivalidator
openapi openapi-spec openapi3 wiremock wiremock-mappings
Last synced: 26 days ago
JSON representation
Validate your Wiremock mappings against an OpenAPI spec
- Host: GitHub
- URL: https://github.com/tidusjar/wiremock.openapivalidator
- Owner: tidusjar
- License: gpl-3.0
- Created: 2022-06-28T09:14:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-29T07:36:54.000Z (over 2 years ago)
- Last Synced: 2024-11-04T21:45:46.608Z (about 2 months ago)
- Topics: openapi, openapi-spec, openapi3, wiremock, wiremock-mappings
- Language: C#
- Homepage:
- Size: 374 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## WireMock Open API Validator
[![Build](https://github.com/tidusjar/Wiremock.OpenAPIValidator/actions/workflows/build.yml/badge.svg)](https://github.com/tidusjar/Wiremock.OpenAPIValidator/actions/workflows/build.yml)
[![Publish](https://github.com/tidusjar/Wiremock.OpenAPIValidator/actions/workflows/publish.yml/badge.svg)](https://github.com/tidusjar/Wiremock.OpenAPIValidator/actions/workflows/publish.yml)
[![Nuget](https://img.shields.io/nuget/v/Wiremock.OpenAPIValidator)](https://www.nuget.org/packages/Wiremock.OpenAPIValidator/)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=tidusjar_Wiremock.OpenAPIValidator&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=tidusjar_Wiremock.OpenAPIValidator)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 |# Installation
.Net CLI (Global)`dotnet tool install --global Wiremock.OpenAPIValidator`
___
# Usage`wiremockopenapi -o "C:/git/MyApi/OpenApi.yml" -w "C:/git/wiremock/stubs/mappings"`
## Example Workflow
```
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.
```# Example Output
![Example Result](./assets/output.png)