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

Invalid validator file generated #38

Open
Rolandisimo opened this issue Sep 19, 2020 · 0 comments
Open

Invalid validator file generated #38

Rolandisimo opened this issue Sep 19, 2020 · 0 comments

Comments

@Rolandisimo
Copy link

I'm seeing an issue that was supposedly fixed here #17
This issue is still occurring to me in version 2.4.2.

This is a part of the generated validator.

/* tslint:disable */
// generated by typescript-json-validator
import { inspect } from 'util';
import Ajv = require('ajv');
export const ajv = new Ajv({
    allErrors: true,
    coerceTypes: false,
    format: 'fast',
    nullable: true,
    unicode: true,
    uniqueItems: true,
    useDefaults: true,
});

ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));

In the browser I'm getting

blueprint.model.validator.ts:6 Uncaught ReferenceError: Ajv is not defined

Changing import Ajv = require('ajv'); to const Ajv = require('ajv'); makes it work.

Also, interfaces are imported using default import even though the interface file has no default exports.

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

1 participant