mongoose-to-swagger icon indicating copy to clipboard operation
mongoose-to-swagger copied to clipboard

Using "require" property instead of "required"

Open veyselyenilmez opened this issue 3 years ago • 0 comments

Hi there,

By default, description, enum, and required fields are extracted from the mongoose schema definitions and placed into the correspoding swagger properties definitions.

The problem I encountered is that "require" is used instead of "required" in the models' property of the project I am working on. And the result I get when I use props: ["require"] is;

{
  title: 'User',
  properties: {
    active: { type: 'boolean', require: false },
    firstName: { type: 'string', require: false },
    lastName: { type: 'string', require: false },
...

The result I am trying to get is;

{
  title: 'User',
  require: [ 'username', 'email', 'password', 'language' ],
  properties: 
...

Is there a way to get this result?

Thank you.

veyselyenilmez avatar May 02 '21 13:05 veyselyenilmez