Skip to content

How do you handle mongodb ObjectId ? #465

Closed
@balazssoltesz

Description

@balazssoltesz

Hello,

im trying to use express-openapi-validator with mongodb, but I can't figure out how should I handle ObjectId fields.
I have to specify id fields in the openapi.json as string, and in res.json() it will be converted to string as well, but if i set validateResponses to true then it will throw an error for me (id should be string).
Any idea how to handle properly mongodb _id fields?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions