Azure / Azure/typespec-azure

[Bug]: typespec-autorest not outputting correct next link name for xml spec

Open
#1,874 2 comments 0 reactions 0 assignees View on GitHub
bug emitter:autorest
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

### Describe the bug

Given the following typespec definition:
```
/** The next marker of the blobs. */
@Xml.name("NextMarker") nextMarker?: string;
```

The generated openapi spec doesnt have the right next link name:
```
"x-ms-pageable": {
"nextLinkName": "nextMarker"
}
```

Expected output (use the name specified in the `@Xml.name` decorator):
```
"x-ms-pageable": {
"nextLinkName": "NextMarker"
}
```

### Reproduction

Example above

### Checklist

- [x] Follow our [Code of Conduct](https://github.com/azure/typespec-azure/blob/main/CODE_OF_CONDUCT.md)
- [x] 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](https://github.com/Microsoft/TypeSpec/issues/new/choose)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown TypeSpec definition in typespec-autorest and inspect the pageable next-link generation path. Confirm that the generated OpenAPI x-ms-pageable nextLinkName uses the @Xml.name value "NextMarker" rather than the property name "nextMarker".

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.