tdegrunt / jsonschema

JSON Schema validation
Other
1.82k stars 262 forks source link

Validate throw error with `additionalProperties: true` #357

Open ThibaudAV opened 2 years ago

ThibaudAV commented 2 years ago

If I set additionalProperties to true I get this error during validation:

Uncaught TypeError: Parameter 'url' must be a string, not function

If I understand correctly additionalProperties should never be true but only false | Schema. In my case i need to init them to {} right ?

Source : https://github.com/tdegrunt/jsonschema/issues/57#issuecomment-50962408 Code : https://github.com/tdegrunt/jsonschema/blob/6f6512981327c20802852fa32fa3dd4f315f7ce1/lib/attribute.js#L303 Types : https://github.com/tdegrunt/jsonschema/blob/87b9543b2ccfb70449c8da40ee14f0b373a6e6d1/lib/index.d.ts#L74

awwright commented 2 years ago

@ThibaudAV Can you please provide some example code with the expected and actual output?

As far as I know, the validator passes the relevant tests, but I need to see the exact context.