kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

express-openapi: upgrade to ajv v8 types imported #744

Closed asarver closed 3 years ago

asarver commented 3 years ago

fixes the imports for ajv v8 included by @types/ajv for #727

asarver commented 3 years ago

@jsdevel I need help, the package-lock is referring to version 8 of some of the open api libraries (which are pulling ajv 6, not 8) and the two latest PRs that were merged don't have new package versions to pull in those changes

jsdevel commented 3 years ago

@asarver try running ./bin/update-deps

asarver commented 3 years ago

@jsdevel that helped to a certain extent.. I think the issue lies with the fact openapi-request-validator and openapi-response-validator haven't had a version bump / haven't been published with the ajv v8, and are still requiring ajv v6

        "openapi-request-validator": {
            "version": "9.0.0",
            "resolved": "https://registry.npmjs.org/openapi-request-validator/-/openapi-request-validator-9.0.0.tgz",
            "integrity": "sha512-+3l6tNBL+mzFWZjyNzFxqF5xIospEuGuDaooqcYuL4VHvjNZoNcqLQo8okWevnZmMvoECUO/Bu5fyODNFgs/uw==",
            "requires": {
                "ajv": "^6.5.4",
                "content-type": "^1.0.4",
                "openapi-jsonschema-parameters": "^9.0.0",
                "openapi-types": "^9.0.0",
                "ts-log": "^2.1.4"
            }
        },
        "openapi-response-validator": {
            "version": "9.0.0",
            "resolved": "https://registry.npmjs.org/openapi-response-validator/-/openapi-response-validator-9.0.0.tgz",
            "integrity": "sha512-TJRkAw+Ihnz9c2kd8eLTNhgeIIEEiyigCxXXGi0Cs2QXUfd7lDCqub+P454LaAHFjpWuiVRENuLsMNDpPx79aw==",
            "requires": {
                "ajv": "^6.5.4",
                "openapi-types": "^9.0.0"
            }
        },

I'm not sure how the versioning works, but is it possible to republish those to as version 9 with the ajv v8 updates?

jsdevel commented 3 years ago

@asarver i just published openapi-request-validator. can you try now?

jsdevel commented 3 years ago

npm t works now. thanks @asarver ! is this the last package that needs to be updated to ajv 8?

asarver commented 3 years ago

@jsdevel yes this is the last one 😀 I haven't tried the package updates yet, do I need to do something to this PR?

asarver commented 3 years ago

I rebased with master, but still having problems with the build 😞

jsdevel commented 3 years ago

@asarver i'm seeing this:

> express-openapi@9.0.1 prepare /home/travis/build/kogosoftwarellc/open-api/packages/express-openapi
> ../../bin/tsc
index.ts:1:41 - error TS2305: Module '"ajv"' has no exported member 'Format'.
1 import { ErrorObject, FormatDefinition, Format } from 'ajv';
asarver commented 3 years ago

woohoo I got it @jsdevel