feat: publish OpenAPI schema and embedded Swagger UI - #268
Closed
rayzorinc wants to merge 3 commits into
Closed
Conversation
rayzorinc
force-pushed
the
rw/openapi-schema
branch
from
August 12, 2026 22:23
58a34a3 to
ac00eb1
Compare
rayzorinc
marked this pull request as ready for review
August 12, 2026 22:23
rayzorinc
added a commit
to rayzorinc/go-httpbin
that referenced
this pull request
Aug 13, 2026
rayzorinc
force-pushed
the
rw/openapi-schema
branch
from
August 13, 2026 15:48
f4667d2 to
9dd7dc3
Compare
docs: explain OpenAPI route generation
build: run OpenAPI check last
rayzorinc
force-pushed
the
rw/openapi-schema
branch
from
August 13, 2026 15:55
9dd7dc3 to
513db34
Compare
Owner
|
Raymond! It's been too long, I hope you're doing well! A few high level thoughts on this change:
|
Owner
|
(Apologies for accidental close!) |
Author
|
@mccutchen no worries. seems like you have something in progress then and is actively working on it? i can close mine then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
go-httpbin can now describe and explore its HTTP API without relying on an external schema host. It serves an OpenAPI 3.2 document from
/openapi.json, provides a fully embedded Swagger UI under/swagger/, and preserves both routes when the service runs with a path prefix.The schema is derived from the same
http.ServeMuxpatterns used at runtime, which keeps methods and path parameters aligned with the implementation. Swagger assets are vendored into the binary for offline and deployment reliability, and/swagger/doc.jsonprovides a familiar schema alias.A generated
docs/openapi.yamlsnapshot makes the schema available in the repository.make openapirefreshes it, whilemake openapi-checkandmake lintdetect drift.Fixes #177.
Validation
make fmt lint test/api/openapi.json,/api/swagger/doc.json, and/api/swagger/.