Skip to content

Commit a58d7a2

Browse files
Add fallback to old validation endpoint for api:validate (#278)
1 parent 3f6c763 commit a58d7a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/commands/api/validate.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@ class ValidateCommand extends BaseCommand {
3131
return this.executeHttp({
3232
execute: () => getApi([apiPath, 'standardization']),
3333
onResolve: pipeAsync(getResponseContent, JSON.parse),
34+
onReject: () => this.getFallbackValidationResult(apiPath),
3435
options: {}
3536
})
3637
}
38+
39+
/* Required to support older on-prem installations */
40+
getFallbackValidationResult(apiPath) {
41+
return this.executeHttp({
42+
execute: () => getApi([apiPath, 'validation']),
43+
onResolve: pipeAsync(getResponseContent, JSON.parse),
44+
options: {}
45+
})
46+
}
47+
3748
}
3849

3950
ValidateCommand.description = `get validation result for an API version

0 commit comments

Comments
 (0)