From 354e4ae71801a21f2bd1f83092565b37fc5b30a9 Mon Sep 17 00:00:00 2001 From: Leonardo Gama <51037424+Leo10Gama@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:57:49 -0700 Subject: [PATCH] chore: Remove exclusionary logic from schema generation (#5641) Co-authored-by: Leonardo Gama --- schema/make_schema.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/schema/make_schema.py b/schema/make_schema.py index cc9d0dbd54..e1d7e889cf 100644 --- a/schema/make_schema.py +++ b/schema/make_schema.py @@ -78,31 +78,9 @@ class SamCliCommandSchema: def to_schema(self) -> dict: """Return the JSON schema representation of the SAM CLI command.""" - COMMANDS_TO_EXCLUDE = [ # TEMPORARY: for use only while generating piece-by-piece - "deploy", - "build", - "local", - "validate", - "package", - "init", - "delete", - "bootstrap", - "list", - "traces", - "sync", - "publish", - "pipeline", - "logs", - "remote", - ] split_cmd_name = self.name.split("_") formatted_cmd_name = " ".join(split_cmd_name) - exclude_params = split_cmd_name[0] in COMMANDS_TO_EXCLUDE - formatted_params_list = ( - "* " + "\n* ".join([f"{param.name}:\n{param.description}" for param in self.parameters]) - if not exclude_params - else "" - ) + formatted_params_list = "* " + "\n* ".join([f"{param.name}:\n{param.description}" for param in self.parameters]) params_description = f"Available parameters for the {formatted_cmd_name} command:\n{formatted_params_list}" return { @@ -114,9 +92,7 @@ def to_schema(self) -> dict: "title": f"Parameters for the {formatted_cmd_name} command", "description": params_description, "type": "object", - "properties": {param.name: param.to_schema() for param in self.parameters} - if not exclude_params - else {}, + "properties": {param.name: param.to_schema() for param in self.parameters}, }, }, "required": ["parameters"],