Skip to content

docs: fixes comment for Responses property#2891

Open
baywet wants to merge 1 commit into
mainfrom
baywet-patch-1
Open

docs: fixes comment for Responses property#2891
baywet wants to merge 1 commit into
mainfrom
baywet-patch-1

Conversation

@baywet

@baywet baywet commented Jun 15, 2026

Copy link
Copy Markdown
Member

@baywet baywet requested a review from a team as a code owner June 15, 2026 15:54
@baywet baywet enabled auto-merge June 15, 2026 15:54
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage remains at 88%, unchanged from the branch.


Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@sonarqubecloud

Copy link
Copy Markdown

/// REQUIRED. The list of possible responses as they are returned from executing this operation.
/// The list of possible responses as they are returned from executing this operation.
/// </summary>
public OpenApiResponses? Responses { get; set; } = [];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about

writer.WriteRequiredObject(OpenApiConstants.Responses, Responses, callback);

writer.WriteRequiredObject(OpenApiConstants.Responses, Responses, (w, r) => r.SerializeAsV2(w));

Should they be using WriteOptionalObject instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, here is another clue, it used to be required in v2, as well as v3, but was relaxed in 3.1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And no, we shouldn't change this. The specification requires the property to be present with a non null value. WriteRequiredObject will write an empty object if the value is null. ({})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants