Open awwright opened 4 years ago
The interface is also not correct. JSONSchema is quite complex, it would probably make more sense to allow any object
instead of trying to create a type that can handle any arbitrary schema.
For example, take this meta schema for a JSONSchema. This is a perfectly valid JSONSchema, but cannot be used as type Schema
because of multiple issues.
Is it safe to assume that the issues with the type are also not implemented by this library?
Another alternative might be to use the types from https://www.npmjs.com/package/@types/json-schema instead of trying to roll a new one here.
JsonSchema4
type is compatible with this library, but JsonSchema7
is not.
Users have been quite vocal that they use the TypeScript types file for code completion and other things... it shouldn't impact usage at runtime AFAIK.
It doesn't, but you have to add // @ts-ignore
everywhere that you use something the type doesn't support.
Right now, there's no tests that exercise the TypeScript interface. Figure out how to publish tests for this interface, to prevent breakage.
See also: #314 #165 #194 and lots of others