Sphereon-Opensource / SIOP-OID4VP

Self Issued OpenID Provider v2 (SIOP) with optional OpenID for Verifiable Presentations (OpenID4VP)
77 stars 25 forks source link

Importing the library prints to the console #21

Closed honungsburk closed 1 year ago

honungsburk commented 1 year ago

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)
nklomp commented 1 year ago

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?

sksadjad commented 1 year ago

Yes, I can reproduce it in my env, I'll take a look

honungsburk commented 1 year ago

I'm using node v18.8.0, typescript 4.7.4, and ajv 8.11.0

nklomp commented 1 year ago

@sksadjad This was fixed in the soon to be release 0.2.0 version right?

sksadjad commented 1 year ago

@nklomp the pr related to this issue is merged in v2.0.0 branch. But it's not merged in develop yet

nklomp commented 1 year ago

Yes, so it will be in 0.2.0 once we release it

nklomp commented 1 year ago

This ticket was not closed. Should not occur anymore, if it does feel free to reopen