File tree Expand file tree Collapse file tree 16 files changed +53
-58
lines changed
src/Microsoft.OpenApi.OData.Reader/Operation Expand file tree Collapse file tree 16 files changed +53
-58
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
45
45
46
46
// Summary and Description
47
47
string placeHolder = $ "Get { ComplexPropertySegment . Property . Name } property value";
48
- operation . Summary = ReadRestrictions ? . Description ?? Context . Model . GetDescriptionAnnotation ( ComplexPropertySegment . Property ) ?? placeHolder ;
49
- operation . Description = ReadRestrictions ? . LongDescription ?? Context . Model . GetLongDescriptionAnnotation ( ComplexPropertySegment . Property ) ?? placeHolder ;
48
+ operation . Summary = ReadRestrictions ? . Description ?? placeHolder ;
49
+ operation . Description = ReadRestrictions ? . LongDescription ?? Context . Model . GetDescriptionAnnotation ( ComplexPropertySegment . Property ) ?? placeHolder ;
50
50
51
51
base . SetBasicInfo ( operation ) ;
52
52
}
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
48
48
49
49
// Summary and Description
50
50
string placeHolder = $ "Sets a new value for the collection of { ComplexPropertySegment . ComplexType . Name } .";
51
- operation . Summary = placeHolder ;
52
- operation . Description = InsertRestrictions ? . Description ?? Context . Model . GetDescriptionAnnotation ( ComplexPropertySegment . Property ) ;
51
+ operation . Summary = InsertRestrictions ? . Description ?? placeHolder ;
52
+ operation . Description = InsertRestrictions ? . LongDescription ;
53
53
54
54
base . SetBasicInfo ( operation ) ;
55
55
}
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
33
33
{
34
34
// Summary and Description
35
35
string placeHolder = $ "Update property { ComplexPropertySegment . Property . Name } value.";
36
- operation . Summary = UpdateRestrictions ? . Description ?? Context . Model . GetDescriptionAnnotation ( ComplexPropertySegment . Property ) ?? placeHolder ;
37
- operation . Description = UpdateRestrictions ? . LongDescription ?? Context . Model . GetLongDescriptionAnnotation ( ComplexPropertySegment . Property ) ?? placeHolder ;
36
+ operation . Summary = UpdateRestrictions ? . Description ?? placeHolder ;
37
+ operation . Description = UpdateRestrictions ? . LongDescription ?? Context . Model . GetLongDescriptionAnnotation ( ComplexPropertySegment . Property ) ;
38
38
39
39
// OperationId
40
40
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ protected override void SetBasicInfo(OpenApiOperation operation)
43
43
// Description
44
44
string placeHolder = "Delete entity from " + EntitySet . Name ;
45
45
operation . Summary = DeleteRestrictions ? . Description ?? placeHolder ;
46
- operation . Description = DeleteRestrictions ? . LongDescription ?? placeHolder ;
46
+ operation . Description = DeleteRestrictions ? . LongDescription ;
47
47
48
48
// OperationId
49
49
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
43
43
44
44
// Description
45
45
string placeHolder = "Get entity from " + EntitySet . Name + " by key" ;
46
- operation . Summary = ReadRestrictions ? . ReadByKeyRestrictions ? . Description ?? Context . Model . GetLongDescriptionAnnotation ( entityType ) ?? placeHolder ;
47
- operation . Description = ReadRestrictions ? . ReadByKeyRestrictions ? . LongDescription ?? Context . Model . GetLongDescriptionAnnotation ( entityType ) ?? placeHolder ;
46
+ operation . Summary = ReadRestrictions ? . ReadByKeyRestrictions ? . Description ?? placeHolder ;
47
+ operation . Description = ReadRestrictions ? . ReadByKeyRestrictions ? . LongDescription ?? Context . Model . GetDescriptionAnnotation ( entityType ) ?? placeHolder ;
48
48
49
49
// OperationId
50
50
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
42
42
{
43
43
// Summary and Descriptions
44
44
string placeHolder = "Get entities from " + EntitySet . Name ;
45
- operation . Summary = ReadRestrictions ? . Description ?? Context . Model . GetDescriptionAnnotation ( EntitySet ) ?? placeHolder ;
46
- operation . Description = ReadRestrictions ? . LongDescription ?? Context . Model . GetLongDescriptionAnnotation ( EntitySet ) ?? placeHolder ;
45
+ operation . Summary = ReadRestrictions ? . Description ?? placeHolder ;
46
+ operation . Description = ReadRestrictions ? . LongDescription ?? Context . Model . GetDescriptionAnnotation ( EntitySet ) ;
47
47
48
48
// OperationId
49
49
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ protected override void SetBasicInfo(OpenApiOperation operation)
42
42
// Summary and Description
43
43
string placeHolder = "Add new entity to " + EntitySet . Name ;
44
44
operation . Summary = InsertRestrictions ? . Description ?? placeHolder ;
45
- operation . Description = InsertRestrictions ? . LongDescription ?? placeHolder ;
45
+ operation . Description = InsertRestrictions ? . LongDescription ;
46
46
47
47
// OperationId
48
48
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ protected override void SetBasicInfo(OpenApiOperation operation)
39
39
// Description
40
40
string placeHolder = "Update entity in " + EntitySet . Name ;
41
41
operation . Summary = UpdateRestrictions ? . Description ?? placeHolder ;
42
- operation . Description = UpdateRestrictions ? . LongDescription ?? placeHolder ;
42
+ operation . Description = UpdateRestrictions ? . LongDescription ;
43
43
44
44
// OperationId
45
45
if ( Context . Settings . EnableOperationId )
Original file line number Diff line number Diff line change @@ -24,18 +24,17 @@ internal class NavigationPropertyDeleteOperationHandler : NavigationPropertyOper
24
24
/// <inheritdoc/>
25
25
protected override void SetBasicInfo ( OpenApiOperation operation )
26
26
{
27
- // Summary
28
- operation . Summary = "Delete navigation property " + NavigationProperty . Name + " for " + NavigationSource . Name ;
27
+ // Summary and Description
28
+ string placeHolder = "Delete navigation property " + NavigationProperty . Name + " for " + NavigationSource . Name ;
29
+ operation . Summary = Restriction ? . DeleteRestrictions ? . Description ?? placeHolder ;
30
+ operation . Description = Restriction ? . DeleteRestrictions ? . LongDescription ;
29
31
30
32
// OperationId
31
33
if ( Context . Settings . EnableOperationId )
32
34
{
33
35
string prefix = "Delete" ;
34
36
operation . OperationId = GetOperationId ( prefix ) ;
35
- }
36
-
37
- // Description
38
- operation . Description = Restriction ? . DeleteRestrictions ? . Description ;
37
+ }
39
38
40
39
base . SetBasicInfo ( operation ) ;
41
40
}
Original file line number Diff line number Diff line change @@ -27,8 +27,12 @@ internal class NavigationPropertyGetOperationHandler : NavigationPropertyOperati
27
27
/// <inheritdoc/>
28
28
protected override void SetBasicInfo ( OpenApiOperation operation )
29
29
{
30
- // Summary
31
- operation . Summary = "Get " + NavigationProperty . Name + " from " + NavigationSource . Name ;
30
+ // Summary and Description
31
+ ReadRestrictionsType readRestriction = Restriction ? . ReadRestrictions ;
32
+ string placeHolder = "Get " + NavigationProperty . Name + " from " + NavigationSource . Name ;
33
+ operation . Summary = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . Description : readRestriction ? . Description ) ?? placeHolder ;
34
+ operation . Description = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . LongDescription : readRestriction ? . LongDescription )
35
+ ?? Context . Model . GetDescriptionAnnotation ( NavigationProperty ) ;
32
36
33
37
// OperationId
34
38
if ( Context . Settings . EnableOperationId )
@@ -41,12 +45,7 @@ protected override void SetBasicInfo(OpenApiOperation operation)
41
45
42
46
operation . OperationId = GetOperationId ( prefix ) ;
43
47
}
44
-
45
- // Description
46
- ReadRestrictionsType readRestriction = Restriction ? . ReadRestrictions ;
47
- operation . Description = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . Description : readRestriction ? . Description )
48
- ?? Context . Model . GetDescriptionAnnotation ( NavigationProperty ) ;
49
-
48
+
50
49
base . SetBasicInfo ( operation ) ;
51
50
}
52
51
Original file line number Diff line number Diff line change @@ -25,8 +25,10 @@ internal class NavigationPropertyPostOperationHandler : NavigationPropertyOperat
25
25
/// <inheritdoc/>
26
26
protected override void SetBasicInfo ( OpenApiOperation operation )
27
27
{
28
- // Summary
29
- operation . Summary = "Create new navigation property to " + NavigationProperty . Name + " for " + NavigationSource . Name ;
28
+ // Summary and Description
29
+ string placeHolder = "Create new navigation property to " + NavigationProperty . Name + " for " + NavigationSource . Name ;
30
+ operation . Summary = Restriction ? . InsertRestrictions ? . Description ?? placeHolder ;
31
+ operation . Description = Restriction ? . InsertRestrictions ? . LongDescription ;
30
32
31
33
// OperationId
32
34
if ( Context . Settings . EnableOperationId )
@@ -35,9 +37,6 @@ protected override void SetBasicInfo(OpenApiOperation operation)
35
37
operation . OperationId = GetOperationId ( prefix ) ;
36
38
}
37
39
38
- // Description
39
- operation . Description = Restriction ? . InsertRestrictions ? . Description ;
40
-
41
40
base . SetBasicInfo ( operation ) ;
42
41
}
43
42
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ internal abstract class NavigationPropertyUpdateOperationHandler : NavigationPro
22
22
/// <inheritdoc/>
23
23
protected override void SetBasicInfo ( OpenApiOperation operation )
24
24
{
25
- // Summary
26
- operation . Summary = "Update the navigation property " + NavigationProperty . Name + " in " + NavigationSource . Name ;
25
+ // Summary and Description
26
+ string placeHolder = "Update the navigation property " + NavigationProperty . Name + " in " + NavigationSource . Name ;
27
+ operation . Summary = Restriction ? . UpdateRestrictions ? . Description ?? placeHolder ;
28
+ operation . Description = Restriction ? . UpdateRestrictions ? . LongDescription ;
27
29
28
30
// OperationId
29
31
if ( Context . Settings . EnableOperationId )
@@ -32,9 +34,6 @@ protected override void SetBasicInfo(OpenApiOperation operation)
32
34
operation . OperationId = GetOperationId ( prefix ) ;
33
35
}
34
36
35
- // Description
36
- operation . Description = Restriction ? . UpdateRestrictions ? . Description ;
37
-
38
37
base . SetBasicInfo ( operation ) ;
39
38
}
40
39
Original file line number Diff line number Diff line change @@ -22,18 +22,17 @@ internal class RefDeleteOperationHandler : NavigationPropertyOperationHandler
22
22
/// <inheritdoc/>
23
23
protected override void SetBasicInfo ( OpenApiOperation operation )
24
24
{
25
- // Summary
26
- operation . Summary = "Delete ref of navigation property " + NavigationProperty . Name + " for " + NavigationSource . Name ;
25
+ // Summary and Description
26
+ string placeHolder = "Delete ref of navigation property " + NavigationProperty . Name + " for " + NavigationSource . Name ;
27
+ operation . Summary = Restriction ? . DeleteRestrictions ? . Description ?? placeHolder ;
28
+ operation . Description = Restriction ? . DeleteRestrictions ? . LongDescription ;
27
29
28
30
// OperationId
29
31
if ( Context . Settings . EnableOperationId )
30
32
{
31
33
string prefix = "DeleteRef" ;
32
34
operation . OperationId = GetOperationId ( prefix ) ;
33
- }
34
-
35
- // Description
36
- operation . Description = Restriction ? . DeleteRestrictions ? . Description ;
35
+ }
37
36
}
38
37
39
38
/// <inheritdoc/>
Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ internal class RefGetOperationHandler : NavigationPropertyOperationHandler
25
25
/// <inheritdoc/>
26
26
protected override void SetBasicInfo ( OpenApiOperation operation )
27
27
{
28
- // Summary
29
- operation . Summary = "Get ref of " + NavigationProperty . Name + " from " + NavigationSource . Name ;
28
+ // Summary and Description
29
+ ReadRestrictionsType readRestriction = Restriction ? . ReadRestrictions ;
30
+ string placeHolder = "Get ref of " + NavigationProperty . Name + " from " + NavigationSource . Name ;
31
+ operation . Summary = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . Description : readRestriction ? . Description ) ?? placeHolder ;
32
+ operation . Description = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . LongDescription : readRestriction ? . LongDescription )
33
+ ?? Context . Model . GetDescriptionAnnotation ( NavigationProperty ) ;
30
34
31
35
// OperationId
32
36
if ( Context . Settings . EnableOperationId )
@@ -39,11 +43,6 @@ protected override void SetBasicInfo(OpenApiOperation operation)
39
43
40
44
operation . OperationId = GetOperationId ( prefix ) ;
41
45
}
42
-
43
- // Description
44
- ReadRestrictionsType readRestriction = Restriction ? . ReadRestrictions ;
45
- operation . Description = ( LastSegmentIsKeySegment ? readRestriction ? . ReadByKeyRestrictions ? . Description : readRestriction ? . Description )
46
- ?? Context . Model . GetDescriptionAnnotation ( NavigationProperty ) ;
47
46
}
48
47
49
48
protected override void SetExtensions ( OpenApiOperation operation )
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ internal class RefPostOperationHandler : NavigationPropertyOperationHandler
22
22
/// <inheritdoc/>
23
23
protected override void SetBasicInfo ( OpenApiOperation operation )
24
24
{
25
- // Summary
26
- operation . Summary = "Create new navigation property ref to " + NavigationProperty . Name + " for " + NavigationSource . Name ;
25
+ // Summary and Description
26
+ string placeHolder = "Create new navigation property ref to " + NavigationProperty . Name + " for " + NavigationSource . Name ;
27
+ operation . Summary = Restriction ? . InsertRestrictions ? . Description ?? placeHolder ;
28
+ operation . Description = Restriction ? . InsertRestrictions ? . LongDescription ;
27
29
28
30
// OperationId
29
31
if ( Context . Settings . EnableOperationId )
@@ -32,8 +34,7 @@ protected override void SetBasicInfo(OpenApiOperation operation)
32
34
operation . OperationId = GetOperationId ( prefix ) ;
33
35
}
34
36
35
- // Description
36
- operation . Description = Restriction ? . InsertRestrictions ? . Description ;
37
+
37
38
}
38
39
39
40
/// <inheritdoc/>
Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ internal class RefPutOperationHandler : NavigationPropertyOperationHandler
22
22
/// <inheritdoc/>
23
23
protected override void SetBasicInfo ( OpenApiOperation operation )
24
24
{
25
- // Summary
26
- operation . Summary = "Update the ref of navigation property " + NavigationProperty . Name + " in " + NavigationSource . Name ;
25
+ // Summary and Description
26
+ string placeHolder = "Update the ref of navigation property " + NavigationProperty . Name + " in " + NavigationSource . Name ;
27
+ operation . Summary = Restriction ? . UpdateRestrictions ? . Description ?? placeHolder ;
28
+ operation . Description = Restriction ? . UpdateRestrictions ? . LongDescription ;
27
29
28
30
// OperationId
29
31
if ( Context . Settings . EnableOperationId )
30
32
{
31
33
string prefix = "UpdateRef" ;
32
34
operation . OperationId = GetOperationId ( prefix ) ;
33
35
}
34
-
35
- operation . Description = Restriction ? . UpdateRestrictions ? . Description ;
36
36
}
37
37
38
38
/// <inheritdoc/>
You can’t perform that action at this time.
0 commit comments