Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
pmmgithub committed May 11, 2023
1 parent 5140fa8 commit 91ce47c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions xml2json/xml2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,28 +1153,21 @@ def create_json_from_xml(working_dir, file_dir, android_path, cpp_path, rust_pat
data = {}

data['id'] = api_id

# 处理 name 字段
data['name'] = api_name.replace("\n", "") if isinstance(api_name, str) else api_name

# 处理 description 字段
data['description'] = api_desc.replace("\n", "") if isinstance(api_desc, str) else api_desc

# 处理 parameters 字段
data['parameters'] = [
{key.replace("\n", "") if isinstance(key, str) and key is not None else key:
value.replace("\n", "") if isinstance(value, str) and value is not None else value}
for param in json_array
for key, value in param.items()
]

# 处理 returns 字段
data['returns'] = return_values.replace("\n", "") if isinstance(return_values, str) and return_values is not None else return_values


data['is_hide'] = True if api_id in json_hide_id_list or data['name'] == "" else False


print(data)

file_name = path.basename(path.normpath(file_dir))
Expand Down

0 comments on commit 91ce47c

Please sign in to comment.