Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schema generation for c#9 positional record with param tag without example property creating unexpected empty example #2901

Merged
merged 4 commits into from
May 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix missing example property on record xmldoc param tag causing unexp…
…ected empty example string in generated schema
  • Loading branch information
stb-co committed May 16, 2024
commit 235b9088315cd8f8c9921dfc686026d2033a6fe8
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ private void ApplyMemberTags(OpenApiSchema schema, SchemaFilterContext context)
schema.Description = XmlCommentsTextHelper.Humanize(summaryNode);

var example = recordDefaultConstructorProperty.GetAttribute("example", string.Empty);
TrySetExample(schema, context, example);
if (!string.IsNullOrEmpty(example))
{
TrySetExample(schema, context, example);
}
}

if (fieldOrPropertyNode != null)
Expand Down
Loading