Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow importing apisprout from external packages #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leonnicolas
Copy link

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 [email protected]

@leonnicolas leonnicolas marked this pull request as ready for review November 28, 2022 14:32
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant