mongoose-to-swagger

Conversion library for transforming Mongoose schema objects into Swagger schema definitions.

MIT License

Stars
55
Committers
9

Bot releases are hidden (Show)

mongoose-to-swagger - Fixed Mixed handling Latest Release

Published by blugavere almost 5 years ago

Fixed bug w/ mixed handling.

mongoose-to-swagger - Support ObjectId type with latest mongoose 5.8.x

Published by blugavere almost 5 years ago

mongoose-to-swagger - 1.0 Release

Published by blugavere almost 5 years ago

  • Added deep object & nested scalar / schema support.

This is technically a breaking change from 0.x versions since previously:

new Schema({
  foo: { bar: String },
})

would result in a swagger output of "foo.bar": { type: "string" } which is valid swagger, but technically incorrect. Now it will result in { foo: { properties: { bar: { type: "string" } } } } which is both valid swagger and has the desired output.

  • Added arbitrary meta field support - common ask was to add arbitrary props like "description" to mongoose schemas and have information propagate out through swagger schema.

  • Added better support for "required" fields.