microsoft / microsoft/typespec

Js client serializer doesn't seem to handle optional properties correctly when model expression is used

Open
#7,562 0 comments 0 reactions 1 assignee Claimed by @timovv View on GitHub
emitter:client:js
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

Image

```tsp
/**
* Full representation of a GitHub repository.
* This model includes all the details of a repository, such as its owner, visibility, license, and various URLs for accessing its resources.
*/
model FullRepository {
/** License information of the repository */
license?: {
/** Key of the license */
key: string;
};
}

/**
* Get a GitHub repository by owner and repository name.
* @param owner - The username or organization name of the repository owner.
* @param repo - The name of the repository.
*/
@tool
@route("/repos/{owner}/{repo}")
op getRepository(owner: string, repo: string): FullRepository;
```

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.