Byron / google-apis-rs

A binding and CLI generator for all Google APIs
http://byron.github.io/google-apis-rs
Other
1.01k stars 131 forks source link

'any' JSON Schema type should be mapped to a json::Value instead of a String #403

Closed xDarksome closed 1 year ago

xDarksome commented 1 year ago

Related to #336

Currently there is a TODO stating:

# TODO: Figure out how to handle it. It's 'interface' in Go ...

(https://github.com/Byron/google-apis-rs/blob/main/src/generator/lib/types.py#L33)

I think the only suitable type here is json::Value.
Using String makes it it impossible to build some payloads, as mentioned in #336.

I would send a PR myself, but, for some reason, after regenerating the code I am getting a diff with size of a half of the project :smiling_face_with_tear: And the changes are mostly unrelated.

Anyway, changing String to json::Value and regenerating the code should be sufficient.

Byron commented 1 year ago

That's awesome! Please feel free to submit a PR, without regenerating all the APIs.

Locally you should be able to test your changes with commands like make drive3-cli-cargo drive3-cargo ARGS=check, substituting the CLI or API that you are interested in.

tyranron commented 1 year ago

@Byron I guess this may be closed now, as should be fixed by #404.

Byron commented 1 year ago

Thanks for the triage-support. It's appreciated.