Skip to content

Commit 177456c

Browse files
committed
Add summary and description to a reference object
1 parent 3db2ffc commit 177456c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Microsoft.OpenApi/Models/OpenApiReference.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ namespace Microsoft.OpenApi.Models
1212
/// </summary>
1313
public class OpenApiReference : IOpenApiSerializable
1414
{
15+
/// <summary>
16+
/// A short summary of the Reference
17+
/// </summary>
18+
public string Summary { get; set; }
19+
20+
/// <summary>
21+
/// A short description of the reference
22+
/// </summary>
23+
public string Description { get; set; }
24+
1525
/// <summary>
1626
/// External resource in the reference.
1727
/// It maybe:
@@ -122,6 +132,8 @@ public OpenApiReference() {}
122132
/// </summary>
123133
public OpenApiReference(OpenApiReference reference)
124134
{
135+
Summary = reference?.Summary;
136+
Description = reference?.Description;
125137
ExternalResource = reference?.ExternalResource;
126138
Type = reference?.Type;
127139
Id = reference?.Id;
@@ -153,6 +165,12 @@ public void SerializeAsV3(IOpenApiWriter writer)
153165
}
154166

155167
writer.WriteStartObject();
168+
169+
// summary
170+
writer.WriteProperty(OpenApiConstants.Summary, Summary);
171+
172+
// description
173+
writer.WriteProperty(OpenApiConstants.Description, Description);
156174

157175
// $ref
158176
writer.WriteProperty(OpenApiConstants.DollarRef, ReferenceV3);

0 commit comments

Comments
 (0)