- A field "jsdoc" is added to fields. It accepts either a string, or an array of strings that represent lines. This is used to add jsdoc comments to the field in the typescript output.
-
Mongoose is no longer included as a regular or peer dependency as it in many cases is not even used. If you do need to do mongoose output, you have to call
setMongoose
from the packageimport { setMongoose } from 'schematar' import * as mongoose from 'mongoose'
setMongoose(mongoose)
- Support arrays of an enum
- Updated dependencies
- Updated dependencies
- mongoose schema generation now supports an options object which can include a transformer for altering the schema generation conditionally using code
- Added allowAdditionalFieldsNested to json schema options. There is a potentially breaking change for subclassed Complex objects, as the second parameter was converted from a boolean to JSONSchemaOptions
- Support for jsonSchema as a plain object added to the json schemadefinition
- Support for mongoose as a plain object added to the mongoose field definition (not supported when outputting as file)
- Schemas can now be used as types (as fields, etc.)
- There is now an API for outputting a typescript interface
- Mongoose is now an optional dependency
- now is also compatible across schematar versions (starting from 1.5.0)
- Arrays in mongoose support things like refs, indices and such
- Complex types that come from different versions of schematar can be used interchangeable (the foreign version needs to be 1.4.0+ though)
- Make mkdirp a regular dependency instead of a dev dependency
- Generated typescript interface files have tslint and eslint completely disabled
- Complex can now be subclassed and the subclasses can modify the output
- Explicit exports for typescriptSchemas can have a complex as the schema
- hashSchema can be called on complexes
- Some dependency updates
- Mongoose nested objects are not wrapped with a {type: ...} as it did not seem to have the intended effect
- ObjectId is now a const string instead a symbol to make is work better in situations with multiple schematar installations
- TypescriptSchemaDefinition is now exported to help set up proper types in schema files
- Updated dependencies