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

Accept Ajv's JSONSchemaType as the schema option #24

Open
voxpelli opened this issue Dec 13, 2022 · 3 comments
Open

Accept Ajv's JSONSchemaType as the schema option #24

voxpelli opened this issue Dec 13, 2022 · 3 comments

Comments

@voxpelli
Copy link

As noted by eg. the team behind workbox, currently it's not supported to use a schema that's typed with Ajv's JSONSchemaType when sending in a schema to this module.

Since it does work in practice, would it be possible to set a more liberal type definition for the schema arg, so that the JSONSchemaType can be accepted as well?

@elsmr
Copy link
Contributor

elsmr commented Dec 20, 2022

Hi @voxpelli thanks for reporting, I wasn't aware of that type. I'll have a look in the coming days!

@voxpelli
Copy link
Author

voxpelli commented Feb 1, 2023

@elsmr Did you get a chance to look at this?

@mike-lischke
Copy link

Additionally, schemas created with "ts-json-schema-generator" are considered not being compatible, even though it works well. The error is:

 Property '"IConfiguration"' is incompatible with index signature.
        Type '{ additionalProperties: boolean; description: string; properties: { lexer: { $ref: string; description: string; }; main: { $ref: string; description: string; }; }; required: string[]; type: string; }' is not assignable to type 'JSONSchema6Definition'.
          Type '{ additionalProperties: boolean; description: string; properties: { lexer: { $ref: string; description: string; }; main: { $ref: string; description: string; }; }; required: string[]; type: string; }' is not assignable to type 'JSONSchema6'.
            Types of property 'type' are incompatible.
              Type 'string' is not assignable to type 'JSONSchema6TypeName | JSONSchema6TypeName[] | undefined'.

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

3 participants