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

Switch kin-openapi to libopenapi #1539

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Switch kin-openapi to libopenapi #1539

wants to merge 2 commits into from

Conversation

yorickvP
Copy link
Contributor

Required for #1482, #1186, #1216

@yorickvP yorickvP requested a review from mattt February 19, 2024 17:33
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
@yorickvP
Copy link
Contributor Author

@yorickvP
Copy link
Contributor Author

Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
@andreasjansson
Copy link
Member

I think it's okay to delete that test case. It's a pretty rare case, and wouldn't be hard to upstream a change to libopenapi to handle that case.

@andreasjansson
Copy link
Member

@yorickvP could you describe in a bit more depth why we need to switch to libopenapi? It's not obvious to me.

@yorickvP
Copy link
Contributor Author

This comment contains a summary: #1186 (comment)

We could try to get away with kin-openapi, that would just require fixing the test for the version in #1552

@zeke
Copy link
Member

zeke commented May 6, 2024

cc @nickstenning who's got a fair bit of experience working with kin-openapi

@nickstenning
Copy link
Member

We use kin-openapi in the api repository to process the schemas generated by cog models, and I would probably want to see us using the same code both here and in production.

What is actually wrong with kin-openapi?

@yorickvP
Copy link
Contributor Author

yorickvP commented May 7, 2024

What is actually wrong with kin-openapi?

No OpenAPI v3.1 support: getkin/kin-openapi#230 (comment)

However, it seems we happen not to use any of the unsupported 3.1 features. Would be good to check somehow.

@nickstenning
Copy link
Member

Our own API's spec is 3.1, and we use kin-openapi to validate it in the api codebase. Is the lack of official 3.1 support actually causing us any problems?

@yorickvP
Copy link
Contributor Author

yorickvP commented May 7, 2024

Here's a list of changes: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 . My concern here is that these schemas are generated from user input by pedantic, so we don't necessarily control it when they break.
The thing we should mainly test is exclusiveMinimum (pydantic's gte).

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.

None yet

4 participants