Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to update schema #5

Open
helen-m-lin opened this issue Oct 30, 2024 · 0 comments
Open

Add instructions to update schema #5

helen-m-lin opened this issue Oct 30, 2024 · 0 comments
Assignees

Comments

@helen-m-lin
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The original specification has some validation issues, so the output is modified. The changes are tracked in schema_changes.json.
These changes need to be written back to openapi.json.

Describe the solution you'd like
Instructions in README on how to update schema in openapi.json using schema_changes.json (ideally using dictdiffer).

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Briefly tried something like this but escaped strings were being altered:

import dictdiffer
import json

with open('schema_changes.json') as f:
    schema_changes = json.load(f)
with open('openapi.json') as f:
    openapi = json.load(f)

dictdiffer.patch(schema_changes, openapi)
with open('openapi.json', 'w') as f:
    json.dump(openapi, f, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant