Closed Dreaming-Codes closed 4 months ago
Comparing it with another post request in the generated code it seams like this part is missing products_acknowledge: https://github.com/Byron/google-apis-rs/blob/ef8dc60e716dba545453f70caca23ac97427fe6c/gen/androidpublisher3/src/api.rs#L36398-L36408
products_consume: https://github.com/Byron/google-apis-rs/blob/ef8dc60e716dba545453f70caca23ac97427fe6c/gen/androidpublisher3/src/api.rs#L36696
There cannot be support for any of the generated APIs, they are provided by Google. This repository is about the generator itself, and no other support can be provided here. Thanks for your understanding.
@Byron Please read what I added above as a comment
Comparing it with another post request in the generated code it seams like this part is missing products_acknowledge: https://github.com/Byron/google-apis-rs/blob/ef8dc60e716dba545453f70caca23ac97427fe6c/gen/androidpublisher3/src/api.rs#L36398-L36408
You can try different versions of the generated code, there is 5.0.3 and 5.0.4, which uses different versions of the API.
@Byron nope products_consume is a new method
@Byron I think that this is a bug in the generator since it's skipping a required post header
Please feel free to submit a PR with a fix. If that allegedly missing header can't be inferred from the API description, maybe the API can be changed to allow the user to inject their own headers.
Please feel free to submit a PR with a fix. If that allegedly missing header can't be inferred from the API description, maybe the API can be changed to allow the user to inject their own headers.
@Byron The header missing is a required http header not a custom one, it's Content-length I mean a post request should always have that even if not specified in the API description
I would fix that, but I really don't know how Mako works.
You can probably look at the generated code to see under which circumstances it does or doesn't add that header.
@Byron the only difference that I notice from other post requests is the missing request key acknowledge: https://github.com/Byron/google-apis-rs/blob/ef8dc60e716dba545453f70caca23ac97427fe6c/etc/api/androidpublisher/v3/androidpublisher-api.json#L3888-L3890
I think that I found the problem. basically when there's no body the generator does not add the Content-length header
Thanks for the research. That sounds like something fixable, even though a fix will have to be contributed.
I think that the error in the generation happens here https://github.com/Byron/google-apis-rs/blob/ef8dc60e716dba545453f70caca23ac97427fe6c/src/generator/templates/api/lib/mbuild.mako#L752-L763
It may be enough to add .header(CONTENT_LENGTH, 0_u64)
between lines 761 and 762.
It appears like it, and is a strange omission as well. You can probably try it locally, and even if not, CI will be able to validate the generated code is still correct.
@Byron I'm trying to get nix on my system to work so I can get python 3.8
Getting a local dev setup is harder than it should be due to needing python, thus I recommend creating a PR with this seemingly trivial change (blindly, if you will), and see if that works.
For local testing, the change can be added by hand in the generated code, and used with your application via [patch."crates-io"]
section in the Cargo manifest.
Getting a local dev setup is harder than it should be due to needing python, thus I recommend creating a PR with this seemingly trivial change (blindly, if you will), and see if that works.
@Byron I've create a pull request with a .devcontainer for easier development
Hi, the latest schema update introduced a new method
google_play_console_hub..purchases().products_consume
which is a fundamental method to consume a bought product to allow the user to buy it again but that method always gives me the following error: