APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.09k stars 154 forks source link

Add support to openAPI 3.1.* #169

Closed TheRealAstoo closed 2 years ago

TheRealAstoo commented 3 years ago

Hi,

Is it possible to add support for openAPI 3.1.0 and more?

I get this error when I try to use it with the 3.1.0 version:

Unsupported OpenAPI version: 3.1.0. Swagger Parser only supports versions 3.0.0, 3.0.1, 3.0.2, 3.0.3

Thank you 😃

philsturgeon commented 3 years ago

Let's make sure we support type: null properly, as was brought up in #138.

mrehanabbasi commented 2 years ago

Any update on this? I'd really like this.

philsturgeon commented 2 years ago

Release process is gnarled up from various Node changes and I dont have time to invest in fixing it.

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/phil/src/swagger-parser/node_modules/node-fetch/src/index.js from /Users/phil/src/swagger-parser/test/specs/real-world/fetch-api-list.js not supported. Instead change the require of index.js in /Users/phil/src/swagger-parser/test/specs/real-world/fetch-api-list.js to a dynamic import() which is available in all CommonJS modules. at Object. (/Users/phil/src/swagger-parser/test/specs/real-world/fetch-api-list.js:3:15) at Object. (/Users/phil/src/swagger-parser/test/specs/real-world/real-world.spec.js:6:22) at async Promise.all (index 0) at async formattedImport (/Users/phil/src/swagger-parser/node_modules/mocha/lib/nodejs/esm-utils.js:7:14) at async Object.exports.requireOrImport (/Users/phil/src/swagger-parser/node_modules/mocha/lib/nodejs/esm-utils.js:48:32) at async Object.exports.loadFilesAsync (/Users/phil/src/swagger-parser/node_modules/mocha/lib/nodejs/esm-utils.js:88:20) at async singleRun (/Users/phil/src/swagger-parser/node_modules/mocha/lib/cli/run-helpers.js:125:3) at async Object.exports.handler (/Users/phil/src/swagger-parser/node_modules/mocha/lib/cli/run.js:374:5)

If anyone can figure that out in a PR I will be able to release this 3.1 support and all the other recent improvements.

philsturgeon commented 2 years ago

Ah that was easy, I just bumped fetch back to v2, but I've got some other issues now. If anyone can help I appreciate it. https://github.com/APIDevTools/swagger-parser/pull/191

gabimoncha commented 2 years ago

@philsturgeon v10.0.3 still throws Unsupported OpenAPI version: 3.1.0. Swagger Parser only supports versions 3.0.0, 3.0.1, 3.0.2, 3.0.3

gigaga commented 2 years ago

Same for me. Any change to have a support for OpenAPI 3.1.0 ? Regards,

swidbert commented 1 year ago

Any update on this?

philsturgeon commented 1 year ago

@swidbert v10.1.0 was meant to include the v3.1.0 changes. Are you having problems with that version?

kdawgwilk commented 1 year ago

What changes in 10.1.0 addressed this issue? Looking through the changes it appears that it was mostly CI changes https://github.com/APIDevTools/swagger-parser/compare/v10.0.5...v10.1.0

philsturgeon commented 1 year ago

This PR was meant to add support for OAS v3.1, if it didn't we should figure out whats gone wrong. https://github.com/APIDevTools/swagger-parser/pull/187

swidbert commented 1 year ago

Many thanks for the feedback. I have been able to identify and solve my problem.

charlie-retzler commented 4 months ago

The issue I had with upgrading from v10.0.3 to v10.1.0 was that the npm package name had to changed from swagger-parser to @apidevtools/swagger-parser. I had to remove the old package and reinstall the new package to get OAS v3.1 support.

philsturgeon commented 4 months ago

Yeah swagger-parser has been deprecated as it was only an alias of the namespaces version and maintaining both was extra problematic. Use the namespaced package to get latest versions.