Skip to content

Commit

Permalink
Merge pull request #132 from i-VRESSE/reclustrsmd
Browse files Browse the repository at this point in the history
Regenerate catalogs from interactive rescore branch
  • Loading branch information
sverhoeven authored Jan 25, 2024
2 parents ec6e1f0 + a65291f commit 6c02cd3
Show file tree
Hide file tree
Showing 5 changed files with 847 additions and 107 deletions.
13 changes: 13 additions & 0 deletions packages/core/src/resolveMaxItemsFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,16 @@ export const ajvKeyword: KeywordDefinition = {
cxt.ok(true)
}
}

/**
* Keyword that can be added to ajv instance with addKeyword()
* to make it aware of `maxPropertiesFrom` keyword in JSON schemas.
*/
export const ajvKeyword2: KeywordDefinition = {
keyword: 'maxPropertiesFrom',
type: 'object',
code (cxt: KeywordCxt) {
// Unable to validate because needs data from outside, so always OK
cxt.ok(true)
}
}
3 changes: 2 additions & 1 deletion packages/core/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ICatalog,
IFiles
} from './types'
import { ajvKeyword, resolveMaxItemsFrom } from './resolveMaxItemsFrom'
import { ajvKeyword, ajvKeyword2, resolveMaxItemsFrom } from './resolveMaxItemsFrom'
import { addMoleculeValidation, parseMolecules } from './molecule/addMoleculeValidation'

const ajv = new Ajv({
Expand All @@ -25,6 +25,7 @@ const ajv = new Ajv({
addFormats(ajv)
addMoleculeFormats(ajv)
ajv.addKeyword(ajvKeyword)
ajv.addKeyword(ajvKeyword2)

export interface IvresseErrorObject
extends ErrorObject<string, Record<string, any>, unknown> {
Expand Down
Loading

0 comments on commit 6c02cd3

Please sign in to comment.