Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

class-validator-jsonschema

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-validator-jsonschema - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

18

__tests__/index.test.ts

@@ -6,5 +6,7 @@ // tslint:disable:no-submodule-imports

getFromContainer,
IsBoolean,
IsEmpty,
IsOptional,
IsString,
Length,
MaxLength,

@@ -40,2 +42,10 @@ MetadataStorage,

user: User
@Length(2, 100)
@IsOptional()
title: string
@IsBoolean()
@IsOptional()
published: true
}

@@ -76,2 +86,10 @@

properties: {
published: {
type: 'boolean'
},
title: {
maxLength: 100,
minLength: 2,
type: 'string'
},
user: {

@@ -78,0 +96,0 @@ $ref: '#/definitions/User'

6

build/index.js

@@ -46,3 +46,3 @@ "use strict";

};
return _.merge(...propertyMetadatas.map(convert));
return _.merge({}, ...propertyMetadatas.map(convert));
}

@@ -53,3 +53,3 @@ function applyDecorators(schema, target, options, propertyName) {

? additionalSchema(schema, options)
: _.merge(schema, additionalSchema);
: _.merge({}, schema, additionalSchema);
}

@@ -71,2 +71,2 @@ function getRequiredPropNames(metadatas, options) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxxREFBaUQ7QUFFakQsNEJBQTJCO0FBRTNCLE1BQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyw2QkFBNkIsQ0FBQyxDQUFBO0FBRTdELDZDQUFnRDtBQUNoRCwyREFBdUQ7QUFDdkQsdUNBQW9EO0FBRXBELDJDQUF5QztBQUFoQyxrQ0FBQSxVQUFVLENBQUE7QUFNb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UFFLElBQUksRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLGtCQUFrQixFQUFFLElBQUksQ0FBQyxDQUFDLENBQUE7SUFDcEUsQ0FBQyxDQUFDO1NBQ0QsSUFBSSxFQUFFO1NBQ04sS0FBSyxFQUFFLENBQUE7QUFDWixDQUFDIn0=

@@ -9,4 +9,8 @@ # Changelog

## [1.0.1] - 2017-11-30
## [1.1.1] - 2018-03-14
### Fixed
- [@scboffspring](https://github.com/scboffspring) fixed schema properties being mutated by `_.merge` [#1](https://github.com/epiphone/class-validator-jsonschema/pull/1)
## [1.1.0] - 2017-11-30
### Added
- Additional class/property schema keywords via the `@JSONSchema` decorator
{
"name": "class-validator-jsonschema",
"version": "1.1.0",
"version": "1.1.1",
"description": "Convert class-validator-decorated classes into JSON schema",

@@ -5,0 +5,0 @@ "keywords": [

@@ -24,3 +24,3 @@ # class-validator-jsonschema

const metadatas = getFromContainer(MetadataStorage).validationMetadata
const metadatas = (getFromContainer(MetadataStorage) as any).validationMetadatas
const schemas = validationMetadatasToSchemas(metadatas)

@@ -27,0 +27,0 @@ console.log(schemas)

@@ -72,3 +72,3 @@ // tslint:disable:no-submodule-imports ban-types

// @ts-ignore: array spread
return _.merge(...propertyMetadatas.map(convert))
return _.merge({}, ...propertyMetadatas.map(convert))
}

@@ -89,3 +89,3 @@

? additionalSchema(schema, options)
: _.merge(schema, additionalSchema)
: _.merge({}, schema, additionalSchema)
}

@@ -92,0 +92,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc