Skip to content

Conversation

AllyW
Copy link
Contributor

@AllyW AllyW commented Mar 10, 2025

No description provided.

@@ -182,7 +182,8 @@ def _generate_command_name(cls, path_item, resource, method, output):
# f"Command Name For Get set to 'list' by nexLink: {resource.path} :"
# f" {path_item.get.operation_id} : {path_item.traces}"
# )
elif sub_url_path in resource.resource_provider.get_resource_map():
elif isinstance(resource, Resource) and sub_url_path in resource.resource_provider.get_resource_map():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why check resource as Resource type can avoid the issue. Why not directly check the resource.resource_provider type?

Copy link
Contributor Author

@AllyW AllyW Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typespec-aaz emitter from frontend will return CMDResource directly which does not have resource_provider and will break here, while swagger api would have a valid Resource and its corresponding resource_provider.

We can check if hasattr(resource, 'resource_provider') directly too, still the root diff comes from CMDResource from typespec-aaz and Resource from swagger translator.

kairu-ms
kairu-ms previously approved these changes Mar 14, 2025
@AllyW AllyW merged commit 7b796c8 into Azure:dev Mar 14, 2025
3 checks passed
@AllyW AllyW mentioned this pull request Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants