Commit Graph

41 Commits

Author SHA1 Message Date
OMGeeky
f07db4c88e improve warn outputs 2024-05-31 15:38:39 +02:00
OMGeeky
04e188ff58 fix pycharm hints 2024-05-31 15:10:42 +02:00
OMGeeky
d80498a8b6 make enums their own class in python to better handle variants where name overlaps might happen 2024-05-31 15:09:06 +02:00
OMGeeky
af71b9ee49 temporary disable links surrounding for cargo doc
it was causing some issues and I want to focus on other things first.
2024-05-18 19:15:35 +02:00
OMGeeky
ad07a13110 make cargo doc a bit happier about links 2024-05-18 17:43:16 +02:00
OMGeeky
ef00af9d13 fix one problem in the CLIs that try to use enums 2024-05-18 14:45:59 +02:00
OMGeeky
c04fa3f800 fix error where default for enum was not properly detected 2024-05-18 00:48:47 +02:00
OMGeeky
006ce5781e Revert "Reapply "fix dict access errors while running test""
This reverts commit b9b8cec7d0.
2024-05-17 23:47:55 +02:00
OMGeeky
3455436f0c fix enum type not being wrapped as Vec if repeated 2024-05-17 23:41:00 +02:00
OMGeeky
b9b8cec7d0 Reapply "fix dict access errors while running test"
This reverts commit 2d9be85963.
2024-05-16 23:30:36 +02:00
OMGeeky
2d9be85963 Revert "fix dict access errors while running test"
This reverts commit c4c38e927f.
2024-05-16 22:55:34 +02:00
OMGeeky
c4c38e927f fix dict access errors while running test
Signed-off-by: OMGeeky <aalaalgmx@gmail.com>
2024-05-16 21:47:06 +02:00
OMGeeky
3e27f63739 generate random values in documentation correctly 2024-05-16 19:20:28 +02:00
OMGeeky
b6c063a854 fix some enums getting wrong names
(some were way too long)
2024-05-15 00:24:23 +02:00
OMGeeky
41049ede1a implement workaround for status singular mistake 2024-05-13 18:29:02 +02:00
OMGeeky
8fc78fe0ae a building version of the enums-change (cli is broken).
(at least youtube3 builds, the others get generated successfully)
2024-05-12 22:10:59 +02:00
Ivan Ukhov
c80e2789f3 Add support for Spanner 2024-04-21 16:41:21 +02:00
Eugene Marcotte
ee4ed07af1 Attempt to add 'standard' base64 bytes support
https://github.com/Byron/google-apis-rs/issues/442 flags an issue where
some APIs respond with non-valid base64 bytes values for the "URL safe"
flavor of configuration.

This adds support for a "standard" wrapper adjacent to the URL safe one
with the intention of finding a way to flag which structures should use
which configuration.
2023-09-26 17:56:57 -04:00
Sebastian Thiel
5cccc5ba83 Manually integrate changes from c43aa69e2b4f87a0c76eb8fd37c221042014d3c1
This was a force-pushed commit that probably doesn't exist for long before
beign collected.

Co-authored-by: Filipp <samoylovfp@gmail.com>
2023-05-08 08:04:46 +02:00
Filipp Samoilov
de51978c69 WIP 2023-04-16 17:50:13 +03:00
Filipp
4ec155d70d WIP fixing relative links
check the FIXMEs
2023-03-28 17:02:29 +03:00
Gary Coady
bd24ea872a Improve handling of plurals in generator.
The generator tries to turn plural into singular nouns.
However, some words turn out badly, including:
 - Addresse (from Addresses)
 - Prefixe (from Prefixes)
 - Bookshelve (from Bookshelves)
 - Sery (from Series)

By using a library, we can get a slightly better outcome.
I've added an exception for "Data", because seeing that
turned into "Datum" is a bit jarring.
2022-11-29 22:51:05 +01:00
philippeitis
9c9c17b923 Fix default values in CLI crates 2022-10-19 20:30:04 -07:00
philippeitis
9fa31bd034 Don't call .to_string() on string values 2022-10-19 15:44:48 -07:00
philippeitis
3183af080a Refactor modification of scopes
`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.

Refactor modification of scopes

`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.

Refactor modification of scopes

`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.
2022-10-14 22:04:40 -07:00
philippeitis
24f361749a Use .to_string() directly for reduction in build size
Went from 3,325,128b to 3,287,744b for accessapproval1 by using .to_string() directly, under --release config.
2022-10-10 17:37:16 -07:00
philippeitis
1c04f662d1 Use correct string impls for http headers 2022-10-09 00:04:30 -07:00
philippeitis
f6cced9605 Support serde for arbitrary field types
This introduces the `serde_with` dependency and `rust_type.py`, to allow supporting arbitrary types for serialization.
Since fields may have arbitrary types (eg. `HashMap<_, chrono::Duration>`) which need deserialization, it is necessary to
use type-based serialization to avoid implementing (de)serialization for every permutation of types that require special serialization.
However, `serde` does not let you (de)serialize one type as another (eg. `chrono::Duration` as `Wrapper`) - thus necessitating `serde_with`, which does. `rust_type.py` introduces the `RustType` class, which makes it easy to describe the (de)serialization type used by `serde_with`
2022-10-08 23:01:30 -07:00
philippeitis
d043fd67b9 Include references to definitions of types 2022-10-08 12:56:54 -07:00
philippeitis
a2d16944cd Make format fully supported 2022-10-08 12:36:59 -07:00
philippeitis
2f3972036c Remove unnecessary examples for ref types 2022-10-08 03:24:47 -07:00
philippeitis
afb96bd264 Add FieldMask and serde impl 2022-10-08 03:22:08 -07:00
philippeitis
23dd5d7c24 chrono example types 2022-10-07 21:46:03 -07:00
philippeitis
158e52399e Use UTC DateTime 2022-10-07 21:35:05 -07:00
philippeitis
66db5c892d Use type constructors for examples 2022-10-07 21:27:13 -07:00
philippeitis
1f10077e44 Find sources for appropriate types 2022-10-07 20:59:51 -07:00
philippeitis
44882a3c44 use chrono::Duration instead of custom client type 2022-10-07 20:44:31 -07:00
philippeitis
29aa8df15b Use appropriate types for date-time, duration, bytes 2022-10-07 13:36:03 -07:00
philippeitis
3d831bcdc6 Use type specified by format key where possible 2022-10-06 22:57:48 -07:00
Kyle Gentle
8ba6acb88b util.py: Make new_context dict-compatible
This is an incremental change towards a strongly-typed util module,
aimed at reducing dependency on the DictObject class. The rough idea is
to annotate everything as Dict, add some tests to codify the existing
behavior, and then start defining dataclasses for the dischovery schema.

We also remove some unused logic & params.
2022-08-18 21:23:55 -04:00
Kyle Gentle
08552c4364 Restructure src dir
Make a few changes in the toplevel src dir to help separate
templates from code. Specifically, we rename `src/mako` to
`src/generator`, and nest the mako templates inside a
`src/generator/templates` dir.

This isolates most Python code into the `src/generator/lib` dir.
2022-08-18 21:23:55 -04:00