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

AWS.ApiGatewayV2.import_api and reimport_api may not work as expected #89

Open
dergraf opened this issue Aug 23, 2021 · 1 comment
Open
Assignees

Comments

@dergraf
Copy link

dergraf commented Aug 23, 2021

Hello

I think I've found an issue with the way the APIGatewayV2 import/reimport code has been generated (tested with the current hex release 0.8.0):

I expect that AWS.ApiGatewayV2.reimport_api(client, rest_api_id, Jason.encode!(openapi_spec)) would import the openapi spec.
However, AWS returns an HTTP 415 (unsupported media type). I think the issue is related to the enforced use of send_body_as_binary?

I am able to successfully call the API if I disable the send_body_as_binary? as well as changing the expected return code to 200. However, in this case one has to provide a somehow unnatural input, see below:

AWS.ApiGatewayV2.reimport_api(client, rest_api_id, %{"body" => Jason.encode!(openapi_spec)})

Note: In this case body doesn't start with a capital B . (see https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/apis-apiid.html#apis-apiid-schemas)

Interestingly importing an OpenAPI Spec works using the V1 API, where the generated code doesn't use the send_body_as_binary?

Please let me know if I can assist you in any way.

Best,
Andre

@philss
Copy link
Contributor

philss commented Aug 24, 2021

Interesting! I will check there more in deep soon. Thanks, @dergraf!

@philss philss self-assigned this Aug 24, 2021
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