Skip to content

Fix Ajv import #110

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 20, 2022
Merged

Fix Ajv import #110

merged 1 commit into from
May 20, 2022

Conversation

ledleds
Copy link
Contributor

@ledleds ledleds commented May 19, 2022

Thanks for this package! I had trouble finding something to help me validate and OpenApi Doc with nested discriminators but I managed to get this working for my needs and its great!

Opening this PR to fix this issue that cropped up for me, ajv is the default export:

node_modules/express-json-validator-middleware/src/index.d.ts:4:10 - error TS2614: Module '"ajv"' has no exported member 'Ajv'. Did you mean to use 'import Ajv from "ajv"' instead?

4 import { Ajv, ErrorObject, Options as AjvOptions } from "ajv";
           ~~~


Found 1 error.

@ledleds ledleds changed the title Fix import Fix Ajv import May 19, 2022
@ericsmal
Copy link

+1

@codecov-commenter
Copy link

Codecov Report

Merging #110 (13760e5) into main (689fb6d) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main      #110   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           26        26           
=========================================
  Hits            26        26           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 689fb6d...13760e5. Read the comment docs.

@simonplend
Copy link
Collaborator

@ledleds Thanks so much for this fix! I'm going to open a separate PR to automatically type check these type definitions.

I'm surprised this issue hasn't cropped up before. I can only guess that most folk have skipLibCheck enabled in their tsconfig.json.

@simonplend simonplend merged commit c01dbf6 into vacekj:main May 20, 2022
simonplend added a commit that referenced this pull request May 20, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
`npm test` now runs unit tests and type checking of the TypeScript
declarations.

This should help avoid issues like #110.
simonplend added a commit that referenced this pull request May 20, 2022
`npm test` now runs unit tests and type checking of the TypeScript
declarations.

This should help avoid issues like #110.
@simonplend
Copy link
Collaborator

Released in v3.0.1 (npm).

@ericsmal
Copy link

Cheers @simonplend, great work you're doing with this package!

@simonplend
Copy link
Collaborator

Thanks @ericsmal!

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

Successfully merging this pull request may close these issues.

4 participants