Azure / Azure/typespec-azure

Generate struct as xml when `mediatTypeHint` decorator applied

Open
#4,937 0 comments 0 reactions 1 assignee Claimed by @jhendrixMSFT View on GitHub
bug emitter:go
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

> Migrated from https://github.com/Azure/autorest.go/issues/1974

---

Model currently not generating as xml even when `mediaTypeHint` decorator applied, generating as json instead

definition models.tsp:
```
/** An encoded string value. */
@mediaTypeHint("application/xml")
model StringEncoded {
/** Whether the value is encoded. */
@Xml.attribute
@Xml.name("Encoded")
encoded?: boolean;

/** The string content. */
@Xml.unwrapped content?: string;
}
```
client.tsp:
```
@@usage(StringEncoded, Usage.output, "go");
```

typespec definition: https://github.com/Azure/azure-rest-api-specs/blob/291f7acea0af046a95187310f01ab2822764b86c/specification/storage/data-plane/FileStorage/models.tsp#L548

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.