-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfield_mode_nullable_vs_defaulted.json
More file actions
81 lines (81 loc) · 2.44 KB
/
Copy pathfield_mode_nullable_vs_defaulted.json
File metadata and controls
81 lines (81 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
"name": "three field modes — strict vs nullable vs defaulted",
"config": {
"_PINEAPPLE_VERSION": "0.10.12",
"pipeline_config": {
"operators": {
"write_nil": {
"type_name": "transform_by_lua",
"lua_script": "function f() return nil end",
"function_for_common": "f",
"function_for_item": "",
"$metadata": {
"common_input": [],
"common_output": ["nullable_field", "strict_field", "defaulted_field"],
"item_input": [],
"item_output": []
}
},
"read_nullable": {
"type_name": "transform_by_lua",
"lua_script": "function f()\n if nullable_field == nil then\n return 'was_nil'\n else\n return tostring(nullable_field)\n end\nend",
"function_for_common": "f",
"function_for_item": "",
"$metadata": {
"common_input": ["nullable_field"],
"common_output": ["nullable_result"],
"item_input": [],
"item_output": []
}
},
"read_defaulted": {
"type_name": "transform_by_lua",
"lua_script": "function f()\n return tostring(defaulted_field)\nend",
"function_for_common": "f",
"function_for_item": "",
"common_defaults": {"defaulted_field": "fallback"},
"$metadata": {
"common_input": ["defaulted_field"],
"common_output": ["defaulted_result"],
"item_input": [],
"item_output": []
}
},
"size": {
"type_name": "transform_size",
"$metadata": {
"common_input": [],
"common_output": ["size"],
"item_input": [],
"item_output": []
}
}
},
"pipeline_map": {}
},
"pipeline_group": {
"main": {
"pipeline": ["write_nil", "read_nullable", "read_defaulted", "size"]
}
},
"flow_contract": {
"common_input": [],
"common_output": ["nullable_result", "defaulted_result", "size"],
"item_input": [],
"item_output": []
}
},
"cases": [
{
"name": "nullable passes nil through, defaulted substitutes fallback",
"request": {
"common": {},
"items": [{"id": "a"}]
},
"expected": {
"common": {"nullable_result": "was_nil", "defaulted_result": "fallback", "size": 1},
"items": [{}]
}
}
]
}