refactor: decouple mongodb driver from root module#222
Merged
fredbi merged 2 commits intogo-openapi:masterfrom Mar 7, 2026
Merged
refactor: decouple mongodb driver from root module#222fredbi merged 2 commits intogo-openapi:masterfrom
fredbi merged 2 commits intogo-openapi:masterfrom
Conversation
* fixes go-openapi#91 * relates to go-openapi#191 Drop go.mongodb.org/mongo-driver/v2 from the root go.mod by introducing an internal minimal BSON codec (bsonlite) that is wire-compatible with mongo-driver v2.5.0. Users who want the real driver can opt in with a blank import: `import _ "github.com/go-openapi/strfmt/enable/mongodb"`. - internal/bsonlite: minimal BSON encoder/decoder for string, DateTime, ObjectID document types (no external dependencies) - enable/mongodb: separate Go module that replaces the lite codec with the real mongo-driver via init() - ObjectId type changed from bsonprim.ObjectID to [12]byte (same underlying type, backward compatible) - All BSON marshal/unmarshal methods rewritten to use bsonlite.C interface - Convert to mono-repo: go.work, CI workflows switched to monorepo variants (ci-workflows v0.2.13), dependabot scans all modules - Integration tests verify both codec paths against real MongoDB Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 85.01% 83.30% -1.72%
==========================================
Files 14 17 +3
Lines 2016 2150 +134
==========================================
+ Hits 1714 1791 +77
- Misses 218 257 +39
- Partials 84 102 +18 ☔ View full report in Codecov by Sentry. |
The go.mod directive (go 1.24) causes setup-go to install go1.24.0, which triggers a panic in testify/v2 goroutine leak detector init(). Use go-version: stable (go1.26) until testify is patched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
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.
Drop go.mongodb.org/mongo-driver/v2 from the root go.mod by introducing an internal minimal BSON codec (bsonlite) that is wire-compatible with mongo-driver v2.5.0. Users who want the real driver can opt in with a blank import:
import _ "github.com/go-openapi/strfmt/enable/mongodb".Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist