tdegrunt / jsonschema

JSON Schema validation
Other
1.83k stars 263 forks source link

`const` has a wrong TypeScript typing #315

Closed 3nvi closed 4 years ago

3nvi commented 4 years ago

Hey there,

Thanks for all your work and for being responsive.

I think I've spotted a small bug with the typings. Namely, I see that const is typed as any[] although the v6 draft states that a const is a single value.

I can help with that, since it's an easy fix. Would you be willing to accept a PR for this?

awwright commented 4 years ago

@3nvi Yes that's right, nice catch.

I just made af3215433e4ce29146593fd18c44ea045a0498f2 to fix this, let me know if that looks correct.

If you know a good way to write tests for the TypeScript definitions, by all means please file a PR. See #316

3nvi commented 4 years ago

That looks perfect, thank you! Is there a chance of a patch release in the coming days?

P.S. Unfortunately, I don't know of a way to properly validate TS. Perhaps by comparing & cross-validating with the typings from ajv you can get some additional re-assurance

awwright commented 4 years ago

@3nvi One or two days, probably.