Defer reading the OpenAPI spec until it is first requested #569
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 259 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.333
Real PR Conversation Timeline
1 comments
"Review active on #569"
general
weight: 0.35
tonygermano
What
SwaggerServlet.initno longer calls.read()on the OpenAPI context it builds. It still registers the configuration (title, description, and the resource classes to document).Why
SwaggerServletdoesn't serve anything; its only job is to register the OpenAPI configuration. The spec is served by swagger'sOpenApiResourceinside Jersey. On its first request,OpenApiResourcelooks up a context under its own servlet's id. It doesn't find one, so it creates a child context whose parent is the default contextSwaggerServletregistered, and reads the spec again. The spec read at startup was never used.Evidence: with the current code, the first
/api/openapi.jsonrequest already takes ~460 ms (and the first/api/4.7.0/openapi.json~230 ms), even thoughSwaggerServlethad just read the spec during startup.Results
Apple M4, JDK 25, default Derby config, no channels; warm medians of 5 runs:
| | Before | After |
|---|---|---|
|
SwaggerServlet.init| ~660 ms | ~120 ms || Jetty
start()| ~1170 ms | ~620 ms || Launch → "Web server running at" | ~4.46 s | ~3.64 s |
| First
/api/openapi.jsonrequest | ~460 ms | ~700 ms || Later
/api/openapi.jsonrequests | ~15 ms | ~15 ms |The cost of the first spec request moves from startup to whoever requests it first (normally someone opening the Swagger UI).
Verification
/api/openapi.json,/api/4.7.0/openapi.jsonand/api/openapi.yamlall return 200 with the "Open Integration Engine Client API" title.jq -S). The raw bytes differ, but key order already varies between two runs of unmodified code../gradlew :server:test: 834 of 836 pass. The two failures (TcpDispatcherTest.testMLLPMessageSent,testMessageSentWhenOneOfMultipleClientsClosed) are aBindExceptionon the test's ports, which count up from 9000. On my machine IntelliJ listens on 9000/9003, so these fail on unmodifiedmainas well.🤖 Generated with Claude Code