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.
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.
`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.
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`
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.
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.