semantic validation bug fix (#319)
* semantic validation bug fix * minor
This commit is contained in:
Родитель
c31480764b
Коммит
0a7acc96f0
|
@ -1,12 +1,16 @@
|
|||
# Changelog
|
||||
|
||||
### 09/25/2018 0.6.1
|
||||
|
||||
- Semantic validation warning bug fix.
|
||||
|
||||
### 09/21/2018 0.6.0
|
||||
|
||||
- Suppression. `where` is not supported yet.
|
||||
|
||||
### 09/21/2018 0.5.13
|
||||
|
||||
- Correcting where we add url and position information to semantic validation errors.
|
||||
- Correcting where we add url and position information to semantic validation errors.
|
||||
|
||||
### 09/19/2018 0.5.12
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import * as pointer from "json-pointer"
|
|||
import { CommonError } from "./commonError"
|
||||
import { StringMap } from "@ts-common/string-map"
|
||||
import { FilePosition } from "@ts-common/source-map"
|
||||
import { ValidationEntry } from "yasway"
|
||||
|
||||
interface ValidationError {
|
||||
validationCategory: string
|
||||
|
@ -20,10 +21,6 @@ interface ValidationError {
|
|||
jsonPosition?: FilePosition
|
||||
}
|
||||
|
||||
interface Warning {
|
||||
readonly code: unknown
|
||||
}
|
||||
|
||||
export class ValidateResponse {
|
||||
|
||||
private readonly mapper: StringMap<string> = {
|
||||
|
@ -84,7 +81,7 @@ export class ValidateResponse {
|
|||
})
|
||||
}
|
||||
|
||||
public sanitizeWarnings(warnings: Warning[]): Warning[] {
|
||||
public sanitizeWarnings(warnings: ValidationEntry[]): ValidationEntry[] {
|
||||
if (!warnings) {
|
||||
throw new Error("validationError cannot be null or undefined.")
|
||||
}
|
||||
|
|
|
@ -66,12 +66,12 @@ export class SemanticValidator extends SpecValidator<SemanticValidationResult> {
|
|||
}
|
||||
if (validationResult.warnings && validationResult.warnings.length > 0) {
|
||||
processErrors(this.getSuppression(), validationResult.warnings)
|
||||
const warnings = validateResponse.sanitizeWarnings(validationResult.warnings)
|
||||
if (warnings && warnings.length) {
|
||||
this.specValidationResult.validateSpec.warnings = warnings
|
||||
validationResult.warnings = validateResponse.sanitizeWarnings(validationResult.warnings)
|
||||
if (validationResult.warnings && validationResult.warnings.length > 0) {
|
||||
this.specValidationResult.validateSpec.warnings = validationResult.warnings
|
||||
log.debug(C.Warnings)
|
||||
log.debug("--------")
|
||||
log.debug(util.inspect(warnings))
|
||||
log.debug(util.inspect(validationResult.warnings))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation",
|
||||
"email": "azsdkteam@microsoft.com",
|
||||
|
|
Загрузка…
Ссылка в новой задаче