Skip to content

Commit 4ddbbad

Browse files
committed
add support for generating model from swagger
1 parent 609aa17 commit 4ddbbad

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.devcontainer/mcp.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"env": {
3131
"AAZ_PATH": "/workspaces/aaz",
3232
"CLI_PATH": "/workspaces/azure-cli",
33-
"CLI_EXTENSION_PATH": "/workspaces/azure-cli-extensions"
33+
"CLI_EXTENSION_PATH": "/workspaces/azure-cli-extensions",
34+
"SWAPPER_PATH": "/workspaces/azure-rest-api-specs"
3435
}
3536
}
3637
}

tools/aaz-flow/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ def generate_code(
1717
aaz_path = os.getenv("AAZ_PATH", "/workspaces/aaz")
1818
cli_path = os.getenv("CLI_PATH", "/workspaces/azure-cli")
1919
cli_extension_path = os.getenv("CLI_EXTENSION_PATH", "/workspaces/azure-cli-extensions")
20+
swagger_path = os.getenv("SWAGGER_PATH", "/workspaces/azure-rest-api-specs")
2021

21-
return (
22-
f"Just run the following command in the terminal: 'aaz-dev cli generate-by-swagger-tag --aaz-path {aaz_path} --cli-path {cli_path} --cli-extension-path {cli_extension_path} --extension-or-module-name {extension_or_module_name} --swagger-module-path {swagger_module_path} --resource-provider {resource_provider} --swagger-tag {swagger_tag} --profile latest'",
22+
swagger_module = swagger_module_path.split("\\")[-1]
23+
24+
des = (
25+
f"Just run the following command in the terminal: 'aaz-dev command-model generate-from-swagger --swagger-path {swagger_path} --swagger-module-path {swagger_module_path} --aaz-path {aaz_path} --module {swagger_module} --resource-provider {resource_provider} --swagger-tag {swagger_tag}'",
26+
f"After the command is run successfully, then run the following command: 'aaz-dev cli generate-by-swagger-tag --aaz-path {aaz_path} --cli-path {cli_path} --cli-extension-path {cli_extension_path} --extension-or-module-name {extension_or_module_name} --swagger-module-path {swagger_module_path} --resource-provider {resource_provider} --swagger-tag {swagger_tag} --profile latest'",
2327
f"After the command is run successfully, this task will be marked as completed.",
2428
)
29+
return des
2530

2631

2732
if __name__ == "__main__":

0 commit comments

Comments
 (0)