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

OpenApi 3.1 support #378

Open
harveycggit opened this issue Feb 27, 2024 · 6 comments
Open

OpenApi 3.1 support #378

harveycggit opened this issue Feb 27, 2024 · 6 comments

Comments

@harveycggit
Copy link

Are there any plans to support OpenApi 3.1? The latest version of 3Scale supposedly supports it. We are using fastapi with some python apps and there is no choice which version of openapi to produce if you don't want to be on an early version of fastapi, you get 3.1.

Thanks in advance!

@eguzki
Copy link
Member

eguzki commented Feb 27, 2024

Currently, the 3scale import openapi command supports OpenAPI 3.0.2 specification. Is there anything you miss in OAS 3.1?

@harveycggit
Copy link
Author

Hi, thanks for the rapid response. It’s not a question of me missing anything, it’s that I am working with a product that cannot export anything less than 3.1.0, which was released in early 2021. We waited quite some time for 3scale to support it and then assumed that we could also pass it through the toolbox :)

@eguzki
Copy link
Member

eguzki commented Feb 28, 2024

I would expect that the toolbox can import OAS 3.1.0 docs without major issues. If you find any issue, please report.

@harveycggit
Copy link
Author

14:25:14 [logs:pod/python-poc-77-import-openapi-2p4dq] {
14:25:14 [logs:pod/python-poc-77-import-openapi-2p4dq] "code": "E_3SCALE",
14:25:14 [logs:pod/python-poc-77-import-openapi-2p4dq] "message": "OpenAPI schema validation failed: The property '#/openapi' value "3.1.0" did not match the regex '^3\.0\.\d(-.+)?$'",
14:25:14 [logs:pod/python-poc-77-import-openapi-2p4dq] "class": "ThreeScaleToolbox::Error"
14:25:14 [logs:pod/python-poc-77-import-openapi-2p4dq] }

Thanks,
Charles

@eguzki
Copy link
Member

eguzki commented Mar 5, 2024

Thanks @harveycggit

Indeed, the validation only accepts swagger 2.0 and OpenAPI 3.0.X

You know that validation can be skipped? (as a workaround for now)

We are more than happy to accept PR's with validation of OpenAPI 3.1.X additionally to the existing ones. I can assist closely. In the meantime, I leave this issue open.

@harveycggit
Copy link
Author

harveycggit commented Mar 7, 2024

Please ignore the post below, this is either a bug in the threescale-jenkins-toolbox or I am doing something incorrectly. When I explicitly set the command in their code it works just fine.

Best,
Charles

Thank you so much. I do know that validation can be skipped but that is not working for me. I am using the 3scale-jenkins-toolbox and it appears to be passing the following command arg to the 3scle-toolbox:

if (!this.openapi.validateOAS) {
commandLine += "--skip-openapi-validation"
}

I'm setting validateOAS to false in my call:
openapi: [filename: "${SwaggerFile}", validateOAS: false]

However, I am still getting the error regarding the regex:
[logs:pod/python-poc-82-import-openapi-5842x] "code": "E_3SCALE",
[logs:pod/python-poc-82-import-openapi-5842x] "message": "OpenAPI schema validation failed: The property '#/openapi' value "3.1.0" did not match the regex '^3\.0\.\d(-.+)?$'",
[logs:pod/python-poc-82-import-openapi-5842x] "class": "ThreeScaleToolbox::Error"

Any ideas? I believe this used to work for me a few years ago.

Thanks,
Charles

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

No branches or pull requests

2 participants