Skip to content

Commit a4b33b0

Browse files
authored
Update post_processing.py
1 parent 6b573c0 commit a4b33b0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

post_processing.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
print("Call post_processing.py")
1+
path = 'src/models.py'
2+
3+
# Read the file content
4+
with open(path, 'r', encoding='utf-8') as file:
5+
content = file.read()
6+
7+
# Add the extra import.
8+
content = 'from pydantic import RootModel\n' + content
9+
10+
# Perform string replacements.
11+
content = content.replace('__root__', 'RootModel').replace('ResponseModel', 'Response')
12+
13+
# Save the new file content.
14+
with open(path, 'w', encoding='utf-8') as file:
15+
file.write(content)

0 commit comments

Comments
 (0)