MCPcopy Create free account
hub / github.com/apolloconfig/apollo / build_parser

Function build_parser

scripts/openapi/check_openapi_compatibility.py:441–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439
440
441def build_parser() -> argparse.ArgumentParser:
442 parser = argparse.ArgumentParser(
443 description="Check Apollo OpenAPI specs for incompatible v1 changes."
444 )
445 parser.add_argument("--base", required=True, help="Baseline OpenAPI spec path or URL")
446 parser.add_argument("--head", required=True, help="Candidate OpenAPI spec path or URL")
447 parser.add_argument(
448 "--allow-removed-path",
449 action="append",
450 default=[],
451 help="Allow every operation under this removed path",
452 )
453 parser.add_argument(
454 "--allow-removed-operation",
455 action="append",
456 default=[],
457 help='Allow one removed operation, formatted like "GET /openapi/v1/apps"',
458 )
459 parser.add_argument(
460 "--allow-operation-id-change",
461 action="append",
462 default=[],
463 help='Allow one operationId change, formatted like "GET /openapi/v1/apps"',
464 )
465 parser.add_argument(
466 "--allow-required-addition",
467 action="append",
468 default=[],
469 help='Allow one new required field, formatted like "OpenAppDTO.appId"',
470 )
471 return parser
472
473
474def main(argv: Optional[List[str]] = None) -> int:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected