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

VSCode syntax checking slow #154

Open
yoshi-68 opened this issue Aug 3, 2023 · 3 comments
Open

VSCode syntax checking slow #154

yoshi-68 opened this issue Aug 3, 2023 · 3 comments
Labels
question Further information is requested

Comments

@yoshi-68
Copy link

yoshi-68 commented Aug 3, 2023

Importing FromSchema slows VSCode's syntax check.

@ThomasAribart
Copy link
Owner

@yoshi-68 Can you provide more details on your issue ? How did you use FromSchema ? What version ? etc.

@ThomasAribart ThomasAribart added the question Further information is requested label Dec 18, 2023
@Seancheey
Copy link

experiencing same issue with generics:

Here is an example:

export class ApiSchema<IN extends JSONSchema, OUT extends JSONSchema> {
    readonly path: string;
    readonly requestSchema: IN;
    readonly responseSchema: OUT;
    readonly requestValidate;

    constructor(path: string, requestSchema: IN, responseSchema: OUT) {
        this.path = path;
        this.requestSchema = requestSchema;
        this.responseSchema = responseSchema;
        this.requestValidate = ajv.compile(requestSchema);
    }

    buildPostApi(
        handle: (requestBody: FromSchema<IN>, request: RequestEvent) => Promise<FromSchema<OUT>>
    ): (event: RequestEventAny) => Response | Promise<Response> {
       ...
    }
}

@fermuch
Copy link

fermuch commented Mar 28, 2024

@Seancheey this might be a bit old and maybe you've moved from it, but the docs in here helped me solve this: https://github.com/ThomasAribart/json-schema-to-ts/blob/main/documentation/FAQs/applying-from-schema-on-generics.md

They should be displayed more promptly!

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

No branches or pull requests

4 participants