Commit ce5b1d2
committed
Allow importing apisprout from external packages
This can be useful for testing go code against the mock server.
The mock server could be started in a go test and the tests are not
dependant on a docker daemon or similar runtime.
To start a server or get a http.Handler without passing a file path or
URL, the server is separated into a server (`OpenAPIServer`) that only
requires an `openapi3.T` to run and the loading from a file or URL is
handled by a `ConfigReloader`. It can load from a URL or file path and
reload the `OpenAPIServer` on file changes.
Signed-off-by: leonnicolas <leonloechner@gmx.de>1 parent 55a1793 commit ce5b1d2
File tree
11 files changed
+1394
-302
lines changed- cmd/apisprout
- testdata
11 files changed
+1394
-302
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments