Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: getAllModels returns models with empty names for Azure Core types #2325

Open
4 tasks done
srnagar opened this issue Mar 6, 2025 · 3 comments
Open
4 tasks done
Labels
bug Something isn't working needs-area

Comments

@srnagar
Copy link
Member

srnagar commented Mar 6, 2025

Describe the bug

When generating from ManufacturingDataSolution.Copilot spec, getAllModels returns a couple of models with no names that are coming from Azure.Core.

Workaround is to use getAllModels(this.sdkContext).filter((model) => !isAzureCoreModel(model));

Image

Image

Reproduction

Run tsp compile <path-to-mds-copilot-spec>/main.tsp and inspect the response of getAllModels() call.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@srnagar srnagar added the bug Something isn't working label Mar 6, 2025
@weidongxu-microsoft
Copy link
Member

Yes, we got 2 model/file without a name. I will need help from TCGC.

The model seems from sdkMethod.lroMetadata.finalResponse

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Mar 7, 2025

playground to reproduce

Image

It is model Instruction + @header operationLocation

However, I think @header operationLocation should not be in finalResponse. It is an indicator for polling.

Also the @pollingOperation would actually change the finalResponse, which is a bit weird.

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Mar 7, 2025

The LRO template is a PATCH, which is against guideline in Azure
https://github.com/Azure/azure-rest-api-specs/pull/33052/files#r1984403422

However, whatever the cause, I'd expect TCGC provides a reasonable name. (even if just LroResposne, LroResponse1...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-area
Projects
None yet
Development

No branches or pull requests

2 participants