Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcruzdev/speckify
https://github.com/mcruzdev/speckify
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mcruzdev/speckify
- Owner: mcruzdev
- Created: 2023-09-07T16:06:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-02T20:29:53.000Z (12 months ago)
- Last Synced: 2024-06-21T00:07:00.402Z (5 months ago)
- Language: Go
- Size: 5.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Speckify
Speckify converts [OpenAPI Specification V3](https://swagger.io/specification/) to Wiremock [Bulk Stubs](https://wiremock.org/docs/stubbing/#bulk-importing-stubs).
> ⚠️ **NOTE** Project status: `development`
## Getting Started
### Installing
Clone this repo:
```shell
git clone [email protected]:mcruzdev/speckify.git
```Build the `speckify` project:
```shell
go build -o speckify cmd/speckify/main.go
```## How-to guides
### How-to generate a Wiremock definition from OpenAPI specification
```
./speckify generate --oapi=openapi.yaml
```After, you can execute the wiremock using docker:
```shell
docker run -it --rm -p 8080:8080 -v "$PWD:/home/wiremock" --name wiremock wiremock/wiremock --verbose
```Make a HTTP request
```shell
curl http://localhost:8080/ping
```The output should looks something like it:
```shell
2023-09-07 18:41:35.197 Request received:
172.17.0.1 - GET /pingHost: [localhost:8080]
Connection: [keep-alive]
Cache-Control: [max-age=0]
sec-ch-ua: ["Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"]
sec-ch-ua-mobile: [?0]
sec-ch-ua-platform: ["macOS"]
Upgrade-Insecure-Requests: [1]
User-Agent: [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36]
Accept: [text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7]
Sec-Fetch-Site: [none]
Sec-Fetch-Mode: [navigate]
Sec-Fetch-User: [?1]
Sec-Fetch-Dest: [document]
Accept-Encoding: [gzip, deflate, br]
Accept-Language: [pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7]Matched response definition:
{
"status" : 200
}Response:
HTTP/1.1 200
Matched-Stub-Id: [f15588fb-cfa9-4a3b-a689-8f8199f9b0ff]
```