Azure / Azure/typespec-azure

[Bug]: union type in sample generation which would return raw json is in-correct in some cases

Open
#1,556 1 comment 0 reactions 1 assignee Claimed by @tadelesh View on GitHub
bug lib:tcgc
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 21h
Merged PRs (30d)
161

Description

### Describe the bug

Currently we will directly return the raw response for union cases in sample generation, this will exist issues when model have different serializeName and client name. I think we should handle part of unions also.

### Reproduction

NA

### 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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.