mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-10 05:22:44 +01:00
feat(config): basis for simplified value setting
Previously we would set static structures manully, using complex cases and utility functions. Now we setup the foundation to allow setting a generic `json::value::Value` instead, which can later be deserialized into the target structure. Related to #111
This commit is contained in:
@@ -55,15 +55,13 @@ ${struct};
|
||||
markers = schema_markers(s, c, transitive=True)
|
||||
# We always need Serialization support, as others might want to serialize the response, even though we will
|
||||
# only deserialize it.
|
||||
traits = ['Clone', 'Debug', 'Serialize']
|
||||
# And since we don't know what others want to do, we implement Deserialize as well by default ...
|
||||
traits = ['Clone', 'Debug', 'Serialize', 'Deserialize']
|
||||
|
||||
# default only works for structs, and 'variant' will be an enum
|
||||
if 'variant' not in s:
|
||||
traits.insert(0, 'Default')
|
||||
|
||||
if RESPONSE_MARKER_TRAIT in markers:
|
||||
traits.append('Deserialize')
|
||||
|
||||
nt_markers = schema_markers(s, c, transitive=False)
|
||||
allow_optionals = is_schema_with_optionals(nt_markers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user