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]: missing-x-ms-identifiers misleading messages #604

Closed
4 tasks done
mjlshen opened this issue Apr 5, 2024 · 1 comment · Fixed by #605
Closed
4 tasks done

[Bug]: missing-x-ms-identifiers misleading messages #604

mjlshen opened this issue Apr 5, 2024 · 1 comment · Fixed by #605
Labels
bug Something isn't working needs-area

Comments

@mjlshen
Copy link
Contributor

mjlshen commented Apr 5, 2024

Describe the bug

default: `Missing identifying properties of objects in the array item, please add @extension("x-ms-identifiers", [<prop>]) to specify it. If there are no appropriate identifying properties, please add @extension("x-ms-identifiers",[]).`,
notArray: paramMessage`Value passed to @extension("x-ms-identifiers",...) was a "${"valueType"}". Pass an array of property name.`,
suggests the use of @extension("x-ms-identifiers", [<prop>]), however the actual decorator should be @OpenAPI.extension("x-ms-identifiers", [<prop>])

https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/missing-x-ms-identifiers

Reproduction

https://azure.github.io/typespec-azure/playground?c=aW1wb3J0ICJAdHlwZXNwZWMvcmVzdCI7CtIZaHR0cMwZYXp1cmUtdG9vbHMvyCUtxhVjb3Jl3yvIK3Jlc291cmNlLW1hbmFnZXIiOwoKdXNpbmcgVHlwZVNwZWMuUmVzdDvQFUh0dHDIFUHESi5Db3JlzhJSx1xNxls7CgpAc2VydmljZSgiV2lkZ2V0xxoiKQpuYW1lc3BhY2UgQ29udG9zby7NIjsKCm1vZGVsIEFkZHJlc3MgewogIGNpdHk6IHN0cmluZzsKIMQKZWV0yhJ9yDXoAIlQcm9wZXJ0aWXGQGFycmF5OshTW10KfQo%3D&e=%40azure-tools%2Ftypespec-autorest&options=%7B%7D

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.
@timotheeguerin
Copy link
Member

The former does work if you have using OpenAPI; but we could use the fully qualified name in the message to reduce confusion

github-merge-queue bot pushed a commit that referenced this issue Apr 5, 2024
… `missing-x-ms-identifiers` linter warning (#605)

Fixes #604 and also resolves a syntax error in the documentation for
`missing-x-ms-identifiers`.

---------

Signed-off-by: Michael Shen <[email protected]>
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
2 participants