Export OpenAPI schema to JSON file.
(output: str)
| 19 | |
| 20 | |
| 21 | def export_openapi(output: str) -> bool: |
| 22 | """Export OpenAPI schema to JSON file.""" |
| 23 | app = get_openapi_app() |
| 24 | |
| 25 | # Create directory if it doesn't exist |
| 26 | if os.path.dirname(output): |
| 27 | os.makedirs(os.path.dirname(output), exist_ok=True) |
| 28 | |
| 29 | with open(output, "w") as f: |
| 30 | json.dump(app.openapi(), f, indent=2) |
| 31 | f.write("\n") |
| 32 | |
| 33 | print(f"✅ OpenAPI schema exported to: {output}") |
| 34 | return True |
| 35 | |
| 36 | |
| 37 | def download_examples(dest: str) -> bool: |