Skip to content

Conversation

@Simran-B
Copy link
Contributor

@Simran-B Simran-B commented Nov 18, 2025

Description

Even with templates.Defer, we cannot properly trigger /openapi-validate at 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:

docker exec <container-id-of-arangoproxy> curl -s http://localhost:8080/openapi-validate

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

  • 3.10:
  • 3.11:
  • 3.12:
  • 4.0:

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.

  • OpenAPI validation (toolchain/arangoproxy):
    • Add thread-safe aggregation with mutexes, counters, and waitgroup; detect duplicate operationIds and method/path conflicts; handle missing versions; return validation errors.
    • ValidateOpenapiHandler now returns HTTP 500 with error details on failures.
    • Write per-version api-docs.json and run swagger-cli validate; surface errors.
  • Build script:
    • start_hugo.sh: after a successful Hugo build, call OPENAPI /openapi-validate and fail the build on non-200; environment-aware proxy URL.
  • Hugo templates:
    • Fix openapi codeblock link resolution to replace stable|devel with current version; send absolute docs URLs.
    • Remove deferred, Hugo-time OpenAPI validation triggers (baseof.html, openapi-validate partial/shortcode).
  • Docs (search-alias Views):
    • Scope endpoints with #searchalias in paths and rename operation IDs to getViewSearchAlias/renameViewSearchAlias for 3.11, 3.12, and 4.0.

Written by Cursor Bugbot for commit 5175b16. This will update automatically on new commits. Configure here.

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.
@Simran-B Simran-B requested a review from nerpaula November 18, 2025 13:51
@arangodb-docs-automation
Copy link
Contributor

Deploy Preview Available Via
https://deploy-preview-835--docs-hugo.netlify.app

@cla-bot cla-bot bot added the cla-signed label Nov 18, 2025
@Simran-B Simran-B self-assigned this Nov 18, 2025
Copy link

@cursor cursor bot left a 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
@Simran-B Simran-B merged commit 4cdae28 into main Nov 21, 2025
6 checks passed
@Simran-B Simran-B deleted the openapi-validation branch November 21, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants