docs: revise swagger.md for validated Scalatra-Swagger approach#85
Merged
Conversation
69c21ef to
482ca55
Compare
a597e7a to
e7958d5
Compare
Revised doc/swagger/swagger.md to reflect the validated Scalatra-Swagger
approach (absolute route paths + empty resourcePath + bathPath override):
- Section 1: SwaggerResourcesApp described as
ScalatraServlet with JacksonJsonSupport with CorsSupport with SwaggerBase
with bathPath override returning Some("/api/v3")
- Section 3: swagger.register() uses empty resourcePath "" with
path-computation table explaining why
- Section 5: Path literals must be ABSOLUTE (was relative) —
updated code examples and rationale for CompositeScalatraFilter dispatch
- Section 7: F3 note corrected — double-prefixing points to wrong
resourcePath, not wrong route literal
- Section 9: Anti-patterns updated with resourcePath, bathPath typo,
catch-all handler annotation prohibition
Validated by tmp/swagger-approach-validation/ with all 7 tests passing
(SC-A through SC-G). See SPEC-FIX #84 for validation results.
Co-authored with AI: OpenCode (ollama-cloud/glm-5)
e7958d5 to
ee0bd41
Compare
…ation style Sections 5 (Required pattern), 6 (Example B - Green), and 9 (anti-patterns) now prescribe the inline form in the route transformer list, matching the prevailing style across all ~150 existing API routes. The val-bound form is still permitted for alias routes that reuse the same operation across multiple declarations, but the default and mandated style is inline. Co-authored with AI: OpenCode (ollama-cloud/glm-5.1)
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
Revised
doc/swagger/swagger.mdSections 1, 3, 5, 7, and 9 to reflect the validated Scalatra-Swagger approach: absolute route paths + emptyresourcePath+bathPathoverride.The previous guidance ("route literals must be relative") was implemented in PR #64 and reverted in fb61938 because relative route paths broke all API routing under
CompositeScaltraFilter— every API endpoint returned 404.Outcome
SwaggerResourcesAppdescribed asScalatraServlet with JacksonJsonSupport with CorsSupport with SwaggerBasewithbathPathoverride returningSome("/api/v3")swagger.register()uses emptyresourcePath""with path-computation table explaining whyCompositeScaltraFilterdispatchresourcePath, not wrong route literalresourcePath,bathPathtypo, catch-all handler annotation prohibitionValidation
All 7 approach-validation tests pass (SC-A through SC-G) in
tmp/swagger-approach-validation/. See SPEC-FIX #84 for detailed validation results.Changes in this PR
doc/swagger/swagger.md.opencode.opencoderepo)The
.opencodesubmodule pointer advance tracks upstream guideline changes in the.opencoderepository — no code impact on this project.Fixes
Addresses SPEC-FIX #84 — revises swagger.md Section 5 route-path guidance from "relative" to "absolute" with empty
resourcePath.🤖 Co-authored with AI: OpenCode (ollama-cloud/glm-5.1)