示例#1
0
 def GetOpenApiDescription(
     self,
     args: None,
     context: Optional[api_call_context.ApiCallContext] = None,
 ) -> api_metadata.ApiGetOpenApiDescriptionHandler:
   del args, context  # Unused.
   return api_metadata.ApiGetOpenApiDescriptionHandler(self)
示例#2
0
def main(argv):
    del argv  # Unused.

    router = api_call_router.ApiCallRouterStub()
    openapi_handler = metadata_plugin.ApiGetOpenApiDescriptionHandler(router)
    openapi_handler_result = openapi_handler.Handle(None)
    openapi_description = openapi_handler_result.openapi_description

    local_json_folder_path = os.path.dirname(flags.FLAGS.local_json_path)
    os.makedirs(local_json_folder_path, exist_ok=True)
    with open(file=flags.FLAGS.local_json_path, mode="w") as file:
        file.write(openapi_description)