Skip to content

Feature Request: Add interface to be more static JsonSchema(mongooseModel) #41

@QuickMick

Description

@QuickMick

i think it would be less error prone to have an option for passing the model to a function, without having the need for extending all the mongoose types.
e.g. i have my models in a different package than the schema-creation script. now i need to include mongoose, for schema creation and it seems, there is something off with peerDependencies or so, because the .jsonSchema function does not exist.

so instead of

mongooseModel.jsonSchema();

i would like to do:

const JsonSChema =require("mongoose-schema-jsonschema");
JsonSchema(mongooseModel);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions