Skip to content

[Feature] Enable openapi v3.1 - #4

Closed
mtrimolet wants to merge 1 commit into
touchifyapp:masterfrom
mtrimolet:@feat/openapi-v3.1
Closed

[Feature] Enable openapi v3.1#4
mtrimolet wants to merge 1 commit into
touchifyapp:masterfrom
mtrimolet:@feat/openapi-v3.1

Conversation

@mtrimolet

Copy link
Copy Markdown
Contributor

Upgrade dependencies (fastify, typescript, ..) and allow for schema using openapi v3.1 to be parsed

@mtrimolet

mtrimolet commented Oct 15, 2021

Copy link
Copy Markdown
ContributorAuthor

Too many upgrades, I need to rebuild without non-core deps upgrades.

Is the support for node v8 still wanted though ? I see @types/node@12 being installed, and it prevents upgrading eslint, typescript, ...
I suppose we could upgrade CI to check from v10 (even v12 ?) through v17, and maybe specify engine versions requirement, matching the type used, in the package.json.

PS: even npm conflicts : package.lock is v2, so uses npm v7, which requires node >=10
(EDIT: extracting-out the openapi part seems ok, I just think we could also upgrade everything else)

@SomaticIT

Copy link
Copy Markdown
Contributor

Is the support for node v8 still wanted though ? I see @types/node@12 being installed, and it prevents upgrading eslint, typescript, ...

Support for node v8 could be safely removed

I suppose we could upgrade CI to check from v10 (even v12 ?) through v17, and maybe specify engine versions requirement, matching the type used, in the package.json.

CI should be updated to test v10, v12, v14 and v16 (only LTS releases).

PS: even npm conflicts : package.lock is v2, so uses npm v7, which requires node >=10

The package-lock.json should be removed from the repo (and added to .gitignore) since it's not part of the published package. It will force contributors to have latest versions of dependencies instead of locked one (better match the npm i fastify-oapi behavior).

This also means we should replace npm ci by npm install in CI workflows

@mtrimolet

Copy link
Copy Markdown
ContributorAuthor

I'll try the simple change here and make another PR for upgrading then

@mtrimolet

mtrimolet commented Oct 15, 2021

Copy link
Copy Markdown
ContributorAuthor

Checks are obviously successful since I only changed some strings.
But maybe we should test an openapi v3.1 specific feature to ensure it's ok to accept it

@SomaticIT

Copy link
Copy Markdown
Contributor

There are some breaking changes:
https://github.com/OAI/OpenAPI-Specification/releases

See: 3.1.0, 3.1.0-rc1, 3.1.0-rc0

The most notable one is the removal of nullable.


We may also need to adjust ajv-openapi default options:

  • allow to specify target OpenAPI version
  • when 3.1: use draft-2020-12 jsonschema version
  • when 3.1: set nullable to false
  • when 3.1: do not include string format validator: byte

Maybe some others...

This pull request was closed.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mtrimolet@SomaticIT