Add required keyword and nullable annotations to http-server-csharp model properties#9439
Conversation
|
@microsoft-github-policy-service agree |
|
I found that after adding @error
model ConflictError {
@statusCode statusCode: 409;
message: string;
}creating an instance of the exception throw new ConflictError("message");produces error Fixed this by adding |
|
@aleksator This is one of the changes we really want to make to the emitter, Unfortunately, it has impacts on the reusability of resource types in PATCH operations and other places where visibility transforms apply to requests and responses. We will need to coordinate this with changes to the controllers and implementation interfaces, and creating new types when they are used in instances where optionality changes. You can track this change here: #5988 |
markcowl
left a comment
There was a problem hiding this comment.
@aleksator This is one of the changes we really want to make to the emitter, Unfortunately, it has impacts on the reusability of resource types in PATCH operations and other places where visibility transforms apply to requests and responses. We will need to coordinate this with changes to the controllers and implementation interfaces, and creating new types when they are used in instances where optionality changes. You can track this change here: #5988
|
Hi @@aleksator. Your PR has had no update for 30 days and it is marked as a stale PR. If it is not updated within 30 days, the PR will automatically be closed. If you want to refresh the PR, please remove the |
Hi folks!
Trying out TypeSpec with http-server-csharp generation in one of the projects - enjoying the generated code so far. Great job!
The most important improvement for me is to have
requiredand nullable annotations for C# model properties as described in #7710, which this PR implements.