import requests import json import os def parse_openapi(): url = "http://172.17.0.1:8000/openapi.json" auth = ("admin", "gemini") try: resp = requests.get(url, auth=auth, timeout=5) resp.raise_for_status() spec = resp.json() schemas = spec.get("components", {}).get("schemas", {}) target_schemas = ["CompanyCreate", "BulkImportRequest", "CompanyUpdate"] print("--- API SCHEMAS FOUND ---") for schema_name in target_schemas: if schema_name in schemas: print(f"\nSchema: {schema_name}") print(json.dumps(schemas[schema_name], indent=2)) else: print(f"\nSchema {schema_name} not found.") except Exception as e: print(f"Error: {e}") if __name__ == "__main__": parse_openapi()