microsoft / microsoft/typespec

Xml.name set uncessarly for some nested object

Open
#8,487 0 comments 0 reactions 0 assignees View on GitHub
emitter:openapi3 feature triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

```tsp
model Author {
@attribute id: string;
book?: Book;
}

model Book {}

```

produce
```yaml
Author:
type: object
required:
- id
properties:
id:
type: string
xml:
attribute: true
book:
allOf:
- $ref: '#/components/schemas/Book'
xml:
name: book
```

[Playground Link](https://typespec.io/playground/?e=%40typespec%2Fopenapi3&c=aW1wb3J0ICJAdHlwZXNwZWMveG1sIjsKCnVzaW5nIFhtbDsKCm1vZGVsIEF1dGhvciB7CiAgQGF0dHJpYnV0ZSBpZDogc3RyaW5nOwogIGJvb2s%2FOiBCb29rOwp9yDrEDyB7fQo%3D&options=%7B%7D&vs=%7B%7D)

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.