mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-08-05 05:34:28 -07:00
Let fields be sent raw in table schema definition
As per https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema the `fields` attribute can recursively define more fields if the `type` attribute is RECORD. There is no way to define recursive argument spec in ansible modules, but if sent as `raw`: > The raw type, performs no type validation or type casting, and maintains the type of the passed value. (from https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec) Which works for what we're trying to accomplish here. Also added integration test for this change
This commit is contained in:
parent
577debb433
commit
63d7025012
3 changed files with 101 additions and 4 deletions
|
@ -181,7 +181,7 @@ options:
|
|||
fields:
|
||||
description:
|
||||
- Describes the nested schema fields if the type property is set to RECORD.
|
||||
elements: str
|
||||
elements: raw
|
||||
required: false
|
||||
type: list
|
||||
mode:
|
||||
|
@ -296,7 +296,7 @@ options:
|
|||
description:
|
||||
- Describes the nested schema fields if the type property is set to
|
||||
RECORD .
|
||||
elements: str
|
||||
elements: raw
|
||||
required: false
|
||||
type: list
|
||||
mode:
|
||||
|
@ -1045,7 +1045,7 @@ def main():
|
|||
elements='dict',
|
||||
options=dict(
|
||||
description=dict(type='str'),
|
||||
fields=dict(type='list', elements='str'),
|
||||
fields=dict(type='list', elements='raw'),
|
||||
mode=dict(type='str'),
|
||||
name=dict(type='str'),
|
||||
type=dict(type='str'),
|
||||
|
@ -1072,7 +1072,7 @@ def main():
|
|||
elements='dict',
|
||||
options=dict(
|
||||
description=dict(type='str'),
|
||||
fields=dict(type='list', elements='str'),
|
||||
fields=dict(type='list', elements='raw'),
|
||||
mode=dict(type='str'),
|
||||
name=dict(type='str'),
|
||||
type=dict(type='str'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue