-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathfix_json_schema.py
More file actions
41 lines (39 loc) · 977 Bytes
/
fix_json_schema.py
File metadata and controls
41 lines (39 loc) · 977 Bytes
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
from unitxt.catalog import add_to_catalog
from unitxt.operators import RecursiveReplace
operator = RecursiveReplace(
key="type",
map_values={
"": "object",
"dict": "object",
"float": "number",
"tuple": "array",
"HashMap": "object",
"bool": "boolean",
"list": "array",
"any": "string",
"int": "integer",
"byte": "integer",
"short": "integer",
"long": "integer",
"double": "number",
"char": "string",
"ArrayList": "array",
"Array": "array",
"Hashtable": "object",
"Queue": "array",
"Stack": "array",
"Any": "string",
"String": "string",
"str, optional": "string",
"str": "string",
"Bigint": "integer",
"Set": "array",
"Boolean": "boolean",
},
remove_values=["any"],
)
add_to_catalog(
operator,
"operators.fix_json_schema",
overwrite=True,
)