-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed not changable relevancy, added case for long adf
- Loading branch information
Mateusz Duda
committed
Jul 11, 2024
1 parent
3628003
commit d27cb28
Showing
9 changed files
with
236 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ import Ajv from "ajv"; | |
import { Logger } from "../Logger/Logger"; | ||
|
||
export class ADFValidator { | ||
private static SCHEMA_URL = "https://unpkg.com/@atlaskit/[email protected]/dist/json-schema/v1/full.json"; | ||
private static SCHEMA_URL = "http://go.atlassian.com/adf-json-schema"; | ||
private static JIRA_COMMENT_MAX_LENGTH = 32_767; | ||
|
||
private _schema: unknown; | ||
|
||
|
@@ -34,6 +35,11 @@ export class ADFValidator { | |
|
||
const ajv = new Ajv({ jsonPointers: true }); | ||
|
||
if(commentJSON.length > ADFValidator.JIRA_COMMENT_MAX_LENGTH) { | ||
console.log(`[ADFValidator] Maximum length of Jira comment (${ADFValidator.JIRA_COMMENT_MAX_LENGTH}) exceeded`); | ||
return false; | ||
} | ||
|
||
const data = JSON.parse(commentJSON); | ||
|
||
const validate = ajv.compile(this._schema); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.