Skip to content

Commit

Permalink
Merge pull request #11 from debitoor/extend-ajvInstance
Browse files Browse the repository at this point in the history
extend-ajvInstance
  • Loading branch information
bifrost authored Oct 4, 2022
2 parents c9406c0 + e193664 commit 0b2d05c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/@types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ export interface SchemaHelper {
export type AvroOptions = Partial<ForSchemaOptions> & {
referencedSchemas?: AvroConfluentSchema[]
}

export type JsonOptions = ConstructorParameters<typeof Ajv>[0] & {
ajvInstance?: {
addSchema: Ajv['addSchema']
compile: (schema: any) => ValidateFunction
}
referencedSchemas?: JsonConfluentSchema[]
Expand Down
1 change: 0 additions & 1 deletion src/JsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default class JsonSchema implements Schema {
if (referencedSchemas) {
referencedSchemas.forEach(rawSchema => {
const $schema = JSON.parse(rawSchema.schema)
// @ts-ignore
ajv.addSchema($schema, $schema['$id'])
})
}
Expand Down

0 comments on commit 0b2d05c

Please sign in to comment.