-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
awscli.clidriver crashes when importing openapi.json #8191
Comments
Hi @houmie - thank you for reaching out. I noticed the edit that you were able to import it, and I wanted to confirm if you're still seeing the issue. One thing i noticed is that might be the culprit is using Let me know if you have any other questions! |
Hi John, Thank you. The issue is happening both with AWS-CLI and with the online API-GATEWAY importer. Both fail on the same issue. Latest FastAPI's swagger generates the openapi file as version 3.1.0
This crashes AWS-CLI / Webform. But if I change it to
then it works. I think the code is internally hardcoded to accept only up to version 3.0.0, anything higher crashes. Best Regards, |
Hi! This part of the debug logs lets you know that this is an error coming back from the server:
If you look above that a few lines, you'll see the full response, including the server HTTP error code. Question: is there any other information coming back in the response or headers? Sometimes services return more details that are not parsed into the final error message. I do agree that this is not very helpful. The API documentation page does not list the supported OpenAPI version supported, and this is the same documentation that is used when generating the AWS CLI documentation page:
However, the usage guide does state this limitation: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html
The documentation and error codes are modeled and managed by the API Gateway team. We can let them know that this is a frustrating error and request that they improve the documentation or the error message. |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
@kdaily Yes, that would be helpful. Thanks |
I've forwarded this feedback to service team. Since there are no actionable item from AWS CLI team, I'm going to close this issue now. Thanks again for sharing this feedback. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
When trying to create an API from openapi spec, we get a crash without any explanation. Our openapi.json is auto generated by FastAPI and validated via https://editor-next.swagger.io
Based on the OpenAPI spec it is correct. So it must be something with AWS.
aws apigateway --debug import-rest-api --body 'file:///Users/houmie/Downloads/release/openapi.json'
We found the issue. See the section: Possible Solution
Expected Behavior
I expected it to import it successfully or at least show what is rejected by AWS API Gateway.
Current Behavior
Error:
Reproduction Steps
When trying to create an API from openapi spec, we get a crash without any explanation. Our openapi.json is auto generated by FastAPI and validated via https://editor-next.swagger.io
Then imported simply by:
aws apigateway --debug import-rest-api --body 'file:///Users/houmie/Downloads/release/openapi.json'
Possible Solution
UPDATE: We have converted the spec to YAML and then AWS Online Importer was able to show us the error on the first line: "openapi":"3.1.0" after changing it to "openapi":"3.0.0". We were able to import it.
Additional Information/Context
No response
CLI version used
2.13.20
Environment details (OS name and version, etc.)
MacOS Ventura 13.5.2 (22G91)
The text was updated successfully, but these errors were encountered: