From b3e800a6a98f44ac3985f6c72cf7cb39c9edcd50 Mon Sep 17 00:00:00 2001 From: Onno Vos Date: Fri, 15 Dec 2023 11:58:19 +0100 Subject: [PATCH] Skip modules which do not contain any actions and hence do not generate valid code --- lib/aws_codegen.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/aws_codegen.ex b/lib/aws_codegen.ex index f3c64e7..cedf8db 100644 --- a/lib/aws_codegen.ex +++ b/lib/aws_codegen.ex @@ -108,11 +108,16 @@ defmodule AWS.CodeGen do template_path = Path.join(template_base_path, template) context = protocol_service.load_context(language, spec, endpoints_spec) - code = render(context, template_path) + case Map.get(context, :actions) do + [] -> + IO.puts(["Skipping ", spec.module_name, " due to no actions"]) + _ -> + code = render(context, template_path) IO.puts(["Writing ", spec.module_name, " to ", output_path]) File.write(output_path, code) + end else IO.puts("Failed to generate #{spec.module_name}, protocol #{spec.protocol}") end