-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[REQ] [rust] Support XML objects in requests and responses #5594
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
The Rust Server generator (which generates both a client and a server) supports receiving and producing XML. Can you clarify which AWS API you are looking at - I had a quick look at one - and it looks like it uses JSON: It looks like they've been converted from the source in https://github.com/aws/aws-sdk-js/tree/master/apis which don't look like OpenAPI APIs at all.... |
Ah, I used the I'm using this API definition: https://github.com/APIs-guru/openapi-directory/blob/master/APIs/amazonaws.com/iam/2010-05-08/openapi.yaml
Yeah, part of this is an exercise to see how many differences there are, and see whether it's even possible to auto-generate a functional client from an openapi spec. As far as I know the AWS service definitions aren't a standard thing, so I thought this was worth an attempt. |
Also, thanks for the quick response, and for your patience as I understand this better. One thing I found is that if I generate the You can see from this issue that the returned content type from AWS is |
No, there's no particular reason. I've added a fix to the Rust Server generator to handle Thanks! |
Thank you @richardwhiuk! I'll keep going on this then. The last thing I'll say is that I think https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/rust.md#wire-format-feature might need to be updated because it says it does have XML support. It might just depend on which library you use though (hyper, reqwest). In any case, since you mentioned |
Is your feature request related to a problem? Please describe.
I'm trying to generate a client that works with these AWS OpenAPI specs, but the AWS API is XML based, and the specs there all have XML definitions.
I don't know for sure how to tell whether a generator supports this, but if I understand correctly based on this comment that says "this option indicates whether XML structures can be defined by spec document and honored by the caller", the
XMLStructureDefinitions
is what says whether a given generator supports XML objects in the requests and responses.However, it doesn't appear that any clients actually support this feature:
Those are all either documentation or server generators.
Describe the solution you'd like
I would like the generated rust code to support XML based service definitions.
I managed to get the generated code working on a basic level (single call), so here's some idea of what I think is needed for this:
Describe alternatives you've considered
I considered using a different language client, but it doesn't seem like I have another option.
However, I also filed this because I'm not sure if I'm actually understanding this correctly, so any corrections are very welcome!
Additional context
The OpenAPI spec was generated from this AWS service definition using this tool and the resulting specs can be found here.
The text was updated successfully, but these errors were encountered: