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

Update OpenAPI to v3.1 #854

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Update OpenAPI to v3.1 #854

merged 1 commit into from
Jul 19, 2024

Conversation

slifty
Copy link
Member

@slifty slifty commented Mar 27, 2024

This PR updates our OpenAPI spec to v3.1

It also makes a small change to remove nullability from a few fields, which should no longer be nullable. This was done as part of the migration because it appears v3.1 changes the way the nullable keyword works.

Resolves #849

This should NOT be merged until after:

@slifty slifty force-pushed the 849-update-openapi-version branch from 9a7bf74 to 4cf1d2b Compare March 27, 2024 21:26
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.57%. Comparing base (a9cc3af) to head (ded7b33).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #854   +/-   ##
=======================================
  Coverage   88.57%   88.57%           
=======================================
  Files         129      129           
  Lines        1725     1725           
  Branches      213      220    +7     
=======================================
  Hits         1528     1528           
+ Misses        197      182   -15     
- Partials        0       15   +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slifty
Copy link
Member Author

slifty commented Mar 27, 2024

I ran the sdk generator locally and it doesn't look like it's up to snuff. For instance:

ApplicationForm.ts (main branch)

import {
	ApplicationFormField,
} from './ApplicationFormField';

import { Writable } from './Writable';

export interface ApplicationForm {
	readonly id: number;
	opportunityId: number;
	readonly version: number;
	fields?: Array<ApplicationFormField>;
	readonly createdAt: Date;
}

export type WritableApplicationForm = Writable<ApplicationForm>

ApplicationForm.ts (generated from this branch)

import { Writable } from './Writable';

export interface ApplicationForm {
	readonly id: any;
	opportunityId: any;
	readonly version: any;
	fields?: any;
	readonly createdAt: any;
}

export type WritableApplicationForm = Writable<ApplicationForm>

I'll look into whether or not this is a swagger-codegen limitation or if I'm doing something wrong here.

@slifty
Copy link
Member Author

slifty commented Mar 27, 2024

Based on swagger-api/swagger-codegen#12210 it looks like codegen doesn't support 3.1.0 yet -- it isn't clear if / when it ever will, though it does seem that the core technologies have been updated to support it, so maybe there's just a dependency version that needs updating somewhere.

@slifty
Copy link
Member Author

slifty commented May 22, 2024

Once this PR is merged we should be able to finish this one: PhilanthropyDataCommons/sdk#26

@slifty slifty force-pushed the 849-update-openapi-version branch from 4cf1d2b to d6e2d75 Compare May 22, 2024 18:25
@slifty slifty requested a review from reefdog May 22, 2024 18:25
@reefdog
Copy link
Contributor

reefdog commented May 22, 2024

Once this PR is merged we should be able to finish this one: PhilanthropyDataCommons/sdk#26

You mean the opposite, right?

@reefdog
Copy link
Contributor

reefdog commented May 22, 2024

From the PR description:

It also makes a small change to remove nullability from a few fields, which should no longer be nullable. This was done as part of the migration because it appears v3.1 changes the way the nullable keyword works.

Is this outdated? I don't see anything referencing nullability.

Copy link
Contributor

@reefdog reefdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In combination with PhilanthropyDataCommons/sdk#26, this worked locally (with all the same caveats re: front end needing to adapt to some changes).

@slifty
Copy link
Member Author

slifty commented May 23, 2024

@reefdog whoops I accidentally nuked the nullable change, I'll either confirm it's needed and add that back in, or will update the PR description. If I add the changes I may ping you for another review, if I just edit the PR description I will not!

That said, we do want to merge the SDK generator changes first since this PR is what will trigger the build / publication of the sdk (and if we merge this before updating the generator, the generator will create a very broken SDK).

EDIT: I'm now seeing the problem -- I wrote "once this pr is merged we'll be able to finish this one" and there is absolutely no way of knowing which "this" refers to THIS pr vs the linked PR. Good job Dan.

@reefdog
Copy link
Contributor

reefdog commented May 24, 2024

@slifty 😆 Yes, that was the source of my confusion. Pronoun antecedents!

@slifty
Copy link
Member Author

slifty commented Jul 10, 2024

We paused the project around May 25th so this got stale!

Reviewing everything and will nudge this to the next step so we can benefit from 3.1 soon

Swagger supports OpenAPI v3.1.0 [1] so we should use it.

Issue #849 Update to OpenAPI 3.1

[1]https://swagger.io/blog/swagger-supports-openapi-3-1/
@slifty slifty force-pushed the 849-update-openapi-version branch from d6e2d75 to ded7b33 Compare July 19, 2024 17:11
@slifty slifty merged commit acdb200 into main Jul 19, 2024
5 checks passed
@slifty slifty deleted the 849-update-openapi-version branch July 19, 2024 17:18
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

Successfully merging this pull request may close these issues.

Update to OpenAPI 3.1
2 participants