Commit Graph

24 Commits

Author SHA1 Message Date
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