Skip to content

Commit

Permalink
feat(stark-core): upgrade 'class-validator' to the latest version (0.…
Browse files Browse the repository at this point in the history
…9.1). Fix breaking changes in validations on ApplicationConfig and Backend entities

ISSUES CLOSED: #1237

BREAKING CHANGES: 'class-validator' upgraded from v0.7.3 to v0.9.1. Not a breaking change in any Stark package; however, if you are using validation decorators from 'class-validator' yourself please check its [CHANGELOG](https://github.com/typestack/class-validator/blob/master/CHANGELOG.md) to know the breaking changes in versions 0.8.x and 0.9.x.
  • Loading branch information
christophercr committed Apr 3, 2019
1 parent 7914fb0 commit ce4f3fb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion greenkeeper.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"packages": ["showcase/package.json", "starter/package.json"]
}
},
"ignore": ["@angular/flex-layout", "@compodoc/compodoc", "@types/node", "class-validator", "typescript"]
"ignore": ["@angular/flex-layout", "@compodoc/compodoc", "@types/node", "typescript"]
}
20 changes: 13 additions & 7 deletions packages/stark-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/stark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/uuid": "^3.4.4",
"@uirouter/angular": "^3.0.0",
"cerialize": "^0.1.18",
"class-validator": "^0.7.3",
"class-validator": "^0.9.1",
"deep-freeze-strict": "^1.1.1",
"ibantools": "^2.0.0",
"lodash-es": "^4.17.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class StarkApplicationConfigImpl implements StarkApplicationConfig {
public keepAliveInterval?: number;

@ValidateIf(StarkApplicationConfigImpl.validateIfKeepAliveEnabled, { groups: ["session"] })
@IsUrl({}, { groups: ["session"] })
@IsUrl({ require_tld: false }, { groups: ["session"] })
@autoserialize
public keepAliveUrl?: string;

Expand All @@ -109,7 +109,7 @@ export class StarkApplicationConfigImpl implements StarkApplicationConfig {
public keepAliveDisabled?: boolean;

@IsDefined({ groups: ["session"] })
@IsUrl({}, { groups: ["session"] })
@IsUrl({ require_tld: false }, { groups: ["session"] })
@autoserialize
public logoutUrl: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class StarkBackendImpl implements StarkBackend {

// validation must be performed always, regardless of validation groups used
@IsNotEmpty({ message: "each backend object MUST have an url", always: true })
@IsUrl({}, { always: true })
@IsUrl({ require_tld: false }, { always: true })
@autoserialize
public url: string;

Expand Down
22 changes: 14 additions & 8 deletions showcase/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce4f3fb

Please sign in to comment.