Importing the library prints to the console
honungsburk opened this issue · 7 comments
Explanation
When importing the library it prints to the console.
Expected behavior
It should not print to the console when you import the library.
How to replicate
Importing the library like so
import { OP, PresentationExchange } from "@sphereon/did-auth-siop";
output
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/_const" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/_enum/items" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/exclusiveMinimum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/exclusiveMaximum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/minimum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV1/properties/maximum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/_const" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/_enum/items" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/exclusiveMinimum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/exclusiveMaximum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/minimum" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/definitions/FilterV2/properties/maximum" (strictTypes)
Thanks for the bug report. This has to do with AJV schema checking. Probably because of a newer version introducing this.
https://ajv.js.org/strict-mode.html#strict-types
The code come from an OpenAPI spec, so we will have to look at the generator. In the mean-time we can work around it by configuring ajv to allow for it.
Could you give a bit more information on the environment you are using it in?
NodeJS version, Typescript version and whether you are using a newer ajv than imported in the package.json?
@ksadjad Could you see whether we can replicate the issue?
Yes, I can reproduce it in my env, I'll take a look
I'm using node v18.8.0, typescript 4.7.4, and ajv 8.11.0
@nklomp the pr related to this issue is merged in v2.0.0 branch. But it's not merged in develop yet
Yes, so it will be in 0.2.0 once we release it
This ticket was not closed. Should not occur anymore, if it does feel free to reopen