Skip to content

Commit 2f8f460

Browse files
committed
resolve the comments for the OpenApiLink and Expressions
1 parent fa534fc commit 2f8f460

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

src/Microsoft.OpenApi/Expressions/RequestExpression.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ public sealed class RequestExpression : RuntimeExpression
1212
{
1313
public const string Request = "$request.";
1414

15-
private SourceExpression _source;
16-
1715
/// <summary>
1816
/// Gets the expression string.
1917
/// </summary>
2018
public override string Expression
2119
{
2220
get
2321
{
24-
return Request + _source.Expression;
22+
return Request + Source.Expression;
2523
}
2624
}
2725

26+
/// <summary>
27+
/// The <see cref="SourceExpression"/> expression.
28+
/// </summary>
29+
public SourceExpression Source { get; }
30+
2831
/// <summary>
2932
/// Initializes a new instance of the <see cref="RequestExpression"/> class.
3033
/// </summary>
3134
/// <param name="source">The source of the request.</param>
3235
public RequestExpression(SourceExpression source)
3336
{
34-
_source = source ?? throw Error.ArgumentNull(nameof(source));
37+
Source = source ?? throw Error.ArgumentNull(nameof(source));
3538
}
3639

3740
public RequestExpression(string expression)

src/Microsoft.OpenApi/Expressions/ResponseExpression.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ public sealed class ResponseExpression : RuntimeExpression
1212
{
1313
public const string Response = "$response.";
1414

15-
private SourceExpression _source;
16-
1715
/// <summary>
1816
/// Gets the expression string.
1917
/// </summary>
2018
public override string Expression
2119
{
2220
get
2321
{
24-
return Response + _source.Expression;
22+
return Response + Source.Expression;
2523
}
2624
}
2725

26+
/// <summary>
27+
/// The <see cref="SourceExpression"/> expression.
28+
/// </summary>
29+
public SourceExpression Source { get; }
30+
2831
/// <summary>
2932
/// Initializes a new instance of the <see cref="ResponseExpression"/> class.
3033
/// </summary>
3134
/// <param name="source">The source of the response.</param>
3235
public ResponseExpression(SourceExpression source)
3336
{
34-
_source = source ?? throw Error.ArgumentNull(nameof(source));
37+
Source = source ?? throw Error.ArgumentNull(nameof(source));
3538
}
3639
}
3740
}

src/Microsoft.OpenApi/Models/OpenApiCallback.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ internal override void WriteAsV3(IOpenApiWriter writer)
9292
/// </summary>
9393
internal override void WriteAsV2(IOpenApiWriter writer)
9494
{
95-
// nothing here
95+
// Callback object does not exist in V2.
9696
}
9797
}
9898
}

src/Microsoft.OpenApi/Models/OpenApiElementExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System;
77
using System.Collections.Generic;
88
using Microsoft.OpenApi.Any;
9-
using Microsoft.OpenApi.Expressions;
109
using Microsoft.OpenApi.Interfaces;
1110
using Microsoft.OpenApi.Properties;
1211

src/Microsoft.OpenApi/Models/OpenApiLink.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ public class OpenApiLink : OpenApiElement, IOpenApiReference, IOpenApiExtension
1717
{
1818
/// <summary>
1919
/// A relative or absolute reference to an OAS operation.
20+
/// This field is mutually exclusive of the operationId field, and MUST point to an Operation Object.
2021
/// </summary>
2122
public string OperationRef { get; set; }
2223

2324
/// <summary>
24-
/// The name of an existing, resolvable OAS operation, as defined with a unique operationId
25+
/// The name of an existing, resolvable OAS operation, as defined with a unique operationId.
26+
/// This field is mutually exclusive of the operationRef field.
2527
/// </summary>
2628
public string OperationId { get; set; }
2729

0 commit comments

Comments
 (0)