| 1 | # API Sample |
| 2 | |
| 3 | This directory contains an OpenAPI description of a sample API |
| 4 | that exercises various OpenAPI features. |
| 5 | |
| 6 | Use this example to try the `gnostic-go-generator` plugin, which implements |
| 7 | `gnostic-go-client` and `gnostic-go-server` for generating API client and |
| 8 | server code, respectively. |
| 9 | |
| 10 | Run "make all" to build and install `gnostic` and the Go plugins. |
| 11 | It will generate both client and server code. The API client and |
| 12 | server code will be in the `sample` package. |
| 13 | |
| 14 | The `service` directory contains additional code that completes the server. |
| 15 | To build and run the service, `cd service` and do the following: |
| 16 | |
| 17 | go get . |
| 18 | go build |
| 19 | ./service & |
| 20 | |
| 21 | To test the service with the generated client, go back up to the top-level |
| 22 | directory and run `go test`. The test in `sample_test.go` uses client |
| 23 | code generated in `sample` to verify the service. |
| 24 |