Skip to content

Commit

Permalink
updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sbansla committed Sep 26, 2024
1 parent c3c4e87 commit 4ead7c4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/build_twilio_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,23 @@ def get_domain_info(oai_spec_location: str, domain: str, is_file: bool = False)
return full_path, domain_name, api_version

def merge_orgs_schema(from_spec, to_spec):
# Load file.json

with open(to_spec, 'r') as f1:
spec1 = json.load(f1)

# Load file2.json

with open(from_spec, 'r') as f2:
spec2 = json.load(f2)

# Assuming both files follow OpenAPI structure, we merge the 'paths' section
if 'paths' in spec1 and 'paths' in spec2:
spec1['paths'].update(spec2['paths'])
else:
print("One of the files doesn't contain 'paths'.")

# Save the merged result into a new file
with open(to_spec, 'w') as outfile:
json.dump(spec1, outfile, indent=2)

print("Files merged successfully into to_spec.")
print(f"Files merged successfully into {to_spec}.")


if __name__ == '__main__':
Expand Down

0 comments on commit 4ead7c4

Please sign in to comment.