Document the given API. Args: discovery_url (str): URI of discovery document. doc_destination_dir (str): relative path where the reference documentation should be saved. artifact_destination_dir (str): relative path where the discovery artifacts should be s
(
discovery_url, doc_destination_dir, artifact_destination_dir=DISCOVERY_DOC_DIR
)
| 461 | |
| 462 | |
| 463 | def document_api_from_discovery_document( |
| 464 | discovery_url, doc_destination_dir, artifact_destination_dir=DISCOVERY_DOC_DIR |
| 465 | ): |
| 466 | """Document the given API. |
| 467 | |
| 468 | Args: |
| 469 | discovery_url (str): URI of discovery document. |
| 470 | doc_destination_dir (str): relative path where the reference |
| 471 | documentation should be saved. |
| 472 | artifact_destination_dir (str): relative path where the discovery |
| 473 | artifacts should be saved. |
| 474 | """ |
| 475 | http = build_http() |
| 476 | response, content = http.request(discovery_url) |
| 477 | discovery = json.loads(content) |
| 478 | |
| 479 | service = build_from_document(discovery) |
| 480 | |
| 481 | name = discovery["version"] |
| 482 | version = safe_version(discovery["version"]) |
| 483 | |
| 484 | document_collection_recursive( |
| 485 | service, |
| 486 | "{}_{}.".format(name, version), |
| 487 | discovery, |
| 488 | discovery, |
| 489 | doc_destination_dir, |
| 490 | artifact_destination_dir, |
| 491 | ) |
| 492 | |
| 493 | |
| 494 | def generate_all_api_documents( |
no test coverage detected
searching dependent graphs…