Skip to content

feat: strip trailing slash config#52

Merged
akfaiz merged 4 commits intomainfrom
feat/strip-trailing-slash-config
Apr 12, 2026
Merged

feat: strip trailing slash config#52
akfaiz merged 4 commits intomainfrom
feat/strip-trailing-slash-config

Conversation

@akfaiz
Copy link
Copy Markdown
Member

@akfaiz akfaiz commented Apr 10, 2026

Description

  • add WithStripTrailingSlash option to remove trailing slashes from operation paths
  • Fix muxopenapi petstore test to use /prefix (leading slash) on PathPrefix calls
  • Remove unused JoinURL helper from pkg/util
  • Fix nil panic in operation.go modifyReqStructure when structure is nil and parameterTagMapping is configured
  • Propagate gen field to subrouters in fiberopenapi, fiberv3openapi, ginopenapi, muxopenapi, httprouteropenapi (calling Validate/GenerateSchema on a sub-router previously caused a nil pointer dereference)
  • Fix httprouteropenapi Handler() passing unprefixed path to spec

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / code quality
  • Other (describe):

Checklist

  • make check passes locally (sync + tidy + lint + test)
  • Tests added or updated to cover the change
  • Golden files updated if spec output changed (make test-update)
  • Relevant documentation updated (README, adapter README, etc.)
  • Commit messages follow Conventional Commits

Notes for Reviewers

akfaiz added 3 commits April 10, 2026 18:58
…om operation paths

- Add StripTrailingSlash field to openapi.Config
- Add WithStripTrailingSlash() OpenAPI option constructor
- Apply stripping in buildOnce before passing paths to reflector
- Fix muxopenapi petstore test to use /prefix (leading slash) on PathPrefix calls
- Remove unused JoinURL helper from pkg/util
- Document WithStripTrailingSlash in README
…Structure

- Fix nil panic in operation.go modifyReqStructure when structure is nil
  and parameterTagMapping is configured
- Propagate gen field to subrouters in fiberopenapi, fiberv3openapi,
  ginopenapi, muxopenapi, httprouteropenapi (calling Validate/GenerateSchema
  on a sub-router previously caused a nil pointer dereference)
- Add gen field to muxopenapi route struct so Subrouter() can forward it
- Fix httprouteropenapi Handler() passing unprefixed path to spec
- Fix chiopenapi Group() passing "/" instead of "" as spec group prefix
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
operation.go 50.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@akfaiz akfaiz merged commit b5985af into main Apr 12, 2026
6 checks passed
@akfaiz akfaiz deleted the feat/strip-trailing-slash-config branch April 12, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant