Skip to content

Improve emitter documentation for handling version mutators in multi-version specs #1992

Description

@AllyW

Describe the bug

The target tsp is from MongoCluster: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/mongocluster/DocumentDB.MongoCluster.Management/main.tsp#L23

When we try to access the properties from metadata of @typespec/http, we cannot find the property groupId added in v4, while this mongoCluster is using commonTypes.v5.

The lost property isgroupId here:

Reproduction

Our emitter is typespec-aaz here: https://github.com/Azure/aaz-dev-tools/tree/dev/src/typespec-aaz
Please clone the emitter above, link it to local npm env and then provide the tspconfig.yaml as following:

Image

And then, run tsp compile ${your_workspaceFolder}/specification/mongocluster/DocumentDB.MongoCluster.Management/main.tsp -- config yourconfig.yaml and check the output file ./tsp-output/@azure-tools/typespec-aaz/resources_operations.json .

we can check properties of privateEndpointConnections and you'll find privateEndpoint, privateLinkServiceConnectionState and other stuff, except groupIds.

Emitter code line for parsing properties of common types PrivateEndpointConnectionProperties is here: https://github.com/Azure/aaz-dev-tools/blob/dev/src/typespec-aaz/src/convertor.ts#L655. We use metadata from @typespec/http and check all its properties for our aaz model generation.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions