Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript types do not allow using draft 7 as a schema #401

Open
PythonCoderAS opened this issue Aug 12, 2024 · 1 comment
Open

Typescript types do not allow using draft 7 as a schema #401

PythonCoderAS opened this issue Aug 12, 2024 · 1 comment

Comments

@PythonCoderAS
Copy link

Trying to use this to validate autogenerated JSON Schemas, and getting an error. So I have the Draft 7 schema inside of an object, and trying to use it as the `schema parameter results in the following error:

Argument of type '{ $schema: string; $id: string; title: string; definitions: { schemaArray: { type: string; minItems: number; items: { $ref: string; }; }; nonNegativeInteger: { type: string; minimum: number; }; nonNegativeIntegerDefault0: { ...; }; simpleTypes: { ...; }; stringArray: { ...; }; }; type: string[]; properties: { ...; }...' is not assignable to parameter of type 'Schema'.
  Types of property 'properties' are incompatible.
    Type '{ $id: { type: string; format: string; }; $schema: { type: string; format: string; }; $ref: { type: string; format: string; }; $comment: { type: string; }; title: { type: string; }; description: { type: string; }; ... 39 more ...; not: { ...; }; }' is not assignable to type '{ [name: string]: Schema; }'.
      Property '"default"' is incompatible with index signature.
        Type 'boolean' has no properties in common with type 'Schema'
@tdegrunt
Copy link
Owner

tdegrunt commented Dec 8, 2024

This was kinda what I was afraid of when typescript types were added.
I have no knowledge of typescript, if you know how to fix it, please contribute a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants