Commit Graph

557 Commits

Author SHA1 Message Date
Sebastian Thiel
3dbb53e924 Make mime 0.2 work with more recent hyper
In 0.2 there is only `Display` available, so we have to be wasteful
by allocating a new string.

However, this is less work than switching to 0.3 which supports
`AsRef`, which is left for another day.
2021-04-01 09:00:54 +08:00
Daniel Rodgers-Pryor
0236e24291 Fixes for CLI code
This doesn't work completely yet because yup_hyper_mock is pulling in old crates: it needs to be updated or removed, but I'm not sure that I have enough context to do it.
2021-02-05 20:15:56 +11:00
Daniel Rodgers-Pryor
b8a66bc666 Update hyper, rustls and yup-oauth2
I've switched to a new M1 laptop which couldn't build the old dependencies because the old ring library version doesn't compile on mac arm (but new version do). There's no way to update ring in isolation, so I've got to update the whole tree at once.
2021-02-04 23:49:07 +11:00
Sebastian Thiel
b88e1633ed Fix rust compile warnings 2021-01-06 22:45:28 +08:00
Sebastian Thiel
60e50da476 Merge branch 'master' into namespaced-items 2021-01-06 21:54:15 +08:00
Sebastian Thiel
3a4151b38c fix sorting of properties by name 2021-01-06 18:24:45 +08:00
Sebastian Thiel
f7aba5114e everything runs through now, only ordering missing 2021-01-06 17:10:36 +08:00
Sebastian Thiel
80dadc5a80 nearly there… 2021-01-05 23:39:04 +08:00
Sebastian Thiel
043f3752e6 basic python 3 port, nearly works 2021-01-05 23:24:57 +08:00
Sebastian Thiel
301f140c83 Basic fixups for python3 2021-01-05 23:02:51 +08:00
Petros Angelatos
9ff51f9417 fix cli imports 2020-12-19 20:15:59 +01:00
Petros Angelatos
87c9c10ce1 remove unused import that was causing a clash
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 19:42:38 +01:00
Petros Angelatos
684d54d445 handle cases where part is a repeated property
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 10:01:58 +01:00
Petros Angelatos
af73936b95 rename cmn to client
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:46:06 +01:00
Petros Angelatos
0e69ffc9eb cleanup top-level namespace and organize items under cmn and api
the top level module re-exports a few very common items like the hub
struct of the particular API and Result, Error, and Delegate.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:44:20 +01:00
Petros Angelatos
b5923b277c use direct references to types to generate documentation
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:44:20 +01:00
Petros Angelatos
38b1ed145c use fully qualified names to access items from cmn
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:44:15 +01:00
Sebastian Thiel
c949124df5 Bump patch level to prep for release 2020-07-10 09:13:01 +08:00
Joel Lathrop
6ad88cb773 Fix '-force' target generation for JSON schemata.
In some environments, a variable-existence test in a template was
yielding a false negative which resulted in the template not generating
'-force' targets for API JSON files, even when the `FETCH_APIS`
environment variable was set during template rendering.

This commit adjusts the way the test for the variable presence is done
such that the '-force' targets now render when they should.
2020-07-09 09:09:51 +08:00
Sebastian Thiel
5e5327f3f7 Use api overrides to specialize building of drive2/3 APIs
This seems preferable over hardcoding special knowledge into the
generator code.
2020-06-05 11:11:17 +08:00
Sebastian Thiel
e06c7c67e0 Avoid talking to google each time dependencies are built…
…which doesn't work very well in certain geographical locations.
This can be triggered using by setting FETCH_API to a value, like

`FETCH_APIS=1 make`
2020-06-05 11:00:24 +08:00
Dennis Vestergaard Værum
041f8951e3 Added the doit_without_upload function to the code generator 2020-06-03 00:33:21 +02:00
Björn Weinehall
6ed8df5f96 Extend attempted error message parsing to also cover ErrorResponse
objects. Fixes errors in e.g. drive3 api not getting passed to delegate
error handlers.
2020-05-29 19:43:50 +08:00
Sebastian Thiel
8e9ce08aa2 Fix typo: enocodable -> encodable
Fixes #250
2020-04-14 08:51:19 +08:00
Sebastian Thiel
94cf4ad569 Make 'cargo test' work by pinning relevant versions 2020-04-12 17:36:05 +08:00
Sebastian Thiel
b66f868ed1 Fix deprecation warnings in CLI 2020-01-18 15:12:24 +08:00
Sebastian Thiel
65b8f0063d Rewrite deprecated features, such as try!
As taken from
https://github.com/Byron/google-apis-rs/pull/247
2020-01-18 14:46:53 +08:00
Sebastian Thiel
f350baa4a7 Fix unit tests 2020-01-18 14:14:07 +08:00
Sebastian Thiel
eb3a6ef578 Truncate all files we open to fix #240
Otherwise it's possible to leave bytes related to a previous version
of the file in tact, tailing the newly written content.
This in turn leads to malformed json when tokens are rewritten.
2019-09-16 07:53:15 +02:00
Sebastian Thiel
bcc72e4fc1 Fields in Error related structs are now accessible
Fixes #239
2019-09-09 08:12:17 +02:00
Tyler Hawkes
f7ac5ebe36 Expose features from yup-oauth2 2019-08-29 10:31:21 +02:00
Sebastian Thiel
5b370e4190 Align CLI generator with changes in string type handling
There was some duplicated logic here.
2019-07-05 18:39:18 +08:00
Sebastian Thiel
4ceeac6320 And once again, python string handling bit me...
...so sick of it. No python, ever again.
Why, but why did I chose Mako back then :D?
2019-07-05 17:26:22 +08:00
Sebastian Thiel
f33fae47e9 Add Rust preprocessor to handle code examples gracefully
Fixes #213
2019-07-05 17:00:56 +08:00
Sebastian Thiel
8cb73d66c2 Add simple preprocessor to handle descriptions interpreted by cargo doc
This seemed easiest, especially since I also am the author of
pulldown-cmark-to-cmark :D.

Funny how things fit together sometimes. And so much better than
if I would have tried the same in pure python.
2019-07-05 14:51:30 +08:00
Sebastian Thiel
24b5faa417 Omit special case for type inference; fixes #180 2019-07-05 11:57:05 +08:00
Sebastian Thiel
99e97ceece Assure API descriptions can contain '"' characters 2019-07-05 11:16:57 +08:00
Sebastian Thiel
25ba809a09 Support types with '-' 2019-07-05 10:44:24 +08:00
Sebastian Thiel
7a44b3eae1 Unconditionally re-export everything in cmn.rs
Related to #218
2019-07-05 10:17:03 +08:00
Sebastian Thiel
a5135985d2 Assure makefile dependency generation doesn't fail if a JSON file doesn't exist locally
For some reason, 'docs-v1' JSON file wasn't present in the repo, and
thus makefile couldn't be generated from scratch.

Now we just ignore this particular error.
2019-07-05 09:47:45 +08:00
Amy K
a2f5625fe3 docs: add lang attribute to docs index
Use the W3 standard "lang" attribute on the "html" tag to provide context for browsers and screen
readers.
2019-07-03 18:27:55 +08:00
Chris Pick
499416c011 fix(rust): teach remove_json_null_values arrays
change `remove_json_null_values()` to properly remove nulls from and recurse in to arrays
google_firestore1_beta1's `CommitRequest` contains an array of `Write` objects which can ultimately
contain `Value` members that need to have nulls removed to avoid sending multiple types of values
which generates a 400 response

fixes calls to google_firestore1_beta1's `hub.projects().databases_documents_commit()`
2019-07-03 18:27:27 +08:00
Guy Taylor
7467f81594 Sort JSON files to minimise git diffs
Sort and format JSON files to remove/minimise any diffs between
update-json runs. This also acts as a JSON validator to error when the
downloaded JSON file has been truncated.
2019-07-03 18:21:35 +08:00
Guy Taylor
93dba234dd Add logging and switch to curl
I am getting many truncated JSON file that then do not parse. More from
wget to curl to see if this helps.
2019-07-03 18:21:35 +08:00
Guy Taylor
57a7ee37e5 Always run Python in the Venv context 2018-12-21 13:05:40 +01:00
gheoan
43b953445e docs(mako): fix typo 2018-12-21 13:00:04 +01:00
Guy Taylor
4faa5f6203 Add first type inferance tests
This slightly changes to code under test by:
* Adding __init__.py files to create modules
* Converts for a.b to a['b'] to allow object or dict types
2018-10-28 11:39:29 +01:00
Guy Taylor
a793af5586 Make utils.method_params private as it is not used.
This removed it been improted into Mako templates and renames it
_method_params to make it clear.
2018-10-28 11:39:29 +01:00
Guy Taylor
9867b260e1 Improve Python testing
Introduce pytest, wire it into Make and convert previous tests.

Note this is not wired into Travis
2018-10-21 22:37:39 +01:00
Sebastian Thiel
0360e61c27 Merge branch 'update_url_to_1_7_1' of https://github.com/edelangh/google-apis-rs into edelangh-update_url_to_1_7_1 2018-10-21 12:08:26 +02:00