-
Notifications
You must be signed in to change notification settings - Fork 9
OpenAPI: Fix and improve validation, resolve conflicts in endpoint descriptions #835
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
Conversation
Move invocation to home.navigation.html and set high output format weight, add locks and debug printing for map in arangoproxy There still appear to be openapi render hook calls after the validation, and Hugo reports the end of the build way before that
…prevent duplicate invocations This is only an issue for endpoint descriptions that contain internal links that get replaced with absolute URLs for api-docs.json / SwaggerUI. Hugo's caching of resources.GetRemote prevents duplicate calls arangoproxy's /openapi if the requests are identical
It no longer gets triggered in live builds (hugo server) but only static builds, where we can reliably start the validation after the build
…operationIds and conflicting endpoint descriptions Note that identical endpoint descriptions for the same version are not considered an error (used for a few View endpoints on purpose). In fact, Hugo's caching of resources.GetRemote prevents arangoproxy from even getting called twice, which we take advantage of.
…View endpoints and operationIds
|
Deploy Preview Available Via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 28
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
arangoproxy's endpoints work with any method (HEAD, POST, ...) but using -I (HEAD) has the advantage that it only returns the HTTP headers
… if needed Also add a temporary bug to an endpoint description for testing
Description
Even with templates.Defer, we cannot properly trigger
/openapi-validateat the end of the Hugo build when all endpoint descriptions are in. A previous sleep of 4 seconds hacked around this issue but to properly address the issue, we need to run the validation after Hugo - which we can only do in static builds but not live builds.It is still possible to trigger the validation manually in a live build:
Things might break when live-editing, because we don't have any logic for replacing OpenAPI descriptions and there will likely be validation errors because of conflicts, but I don't think that we ever supported this.
Upstream PRs
Note
Moves OpenAPI validation to a post-Hugo step with proper error propagation and thread-safe spec aggregation (conflict/duplicate checks), updates templates/linking, and scopes search-alias endpoint paths/operationIds across versions.
operationIds and method/path conflicts; handle missing versions; return validation errors.ValidateOpenapiHandlernow returns HTTP 500 with error details on failures.api-docs.jsonand runswagger-cli validate; surface errors.start_hugo.sh: after a successful Hugo build, callOPENAPI /openapi-validateand fail the build on non-200; environment-aware proxy URL.stable|develwith current version; send absolute docs URLs.baseof.html,openapi-validatepartial/shortcode).#searchaliasinpathsand rename operation IDs togetViewSearchAlias/renameViewSearchAliasfor 3.11, 3.12, and 4.0.Written by Cursor Bugbot for commit 5175b16. This will update automatically on new commits. Configure here.