Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectId.String() breaks swagger validation and CLI #83

Closed
dimovnike opened this issue Aug 14, 2021 · 0 comments
Closed

ObjectId.String() breaks swagger validation and CLI #83

dimovnike opened this issue Aug 14, 2021 · 0 comments

Comments

@dimovnike
Copy link
Contributor

Function ObjectId.String() at

strfmt/bson.go

Line 98 in ac88b91

return bsonprim.ObjectID(id).String()
must use bsonprim.ObjectID(id).Hex() instead of string. The current version breaks swagger validation and CLI generation.

For swagger validation problems please see this issue: go-swagger/go-swagger#2616 (comment)

As for CLI - it sends values in the form of ObjectID("value") to server.
(NOTE: CLI doesn't support ObjectId yet but I tried to implement it and hit this problem)

Changing the String() function as suggested by @youyuanwu the issue above will solve both cases.

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

No branches or pull requests

1 participant