@@ -23,9 +23,9 @@ protected override void Initialize(ODataContext context, ODataPath path)
23
23
{
24
24
base . Initialize ( context , path ) ;
25
25
26
- _updateRestrictions = Context . Model . GetRecord < UpdateRestrictionsType > ( TargetPath , CapabilitiesConstants . UpdateRestrictions ) ;
27
- var complexPropertyUpdateRestrictions = Context . Model . GetRecord < UpdateRestrictionsType > ( ComplexPropertySegment . Property , CapabilitiesConstants . UpdateRestrictions ) ;
28
- _updateRestrictions ? . MergePropertiesIfNull ( complexPropertyUpdateRestrictions ) ;
26
+ _updateRestrictions = Context . Model . GetRecord < UpdateRestrictionsType > ( TargetPath , CapabilitiesConstants . UpdateRestrictions ) ;
27
+ var complexPropertyUpdateRestrictions = Context . Model . GetRecord < UpdateRestrictionsType > ( ComplexPropertySegment . Property , CapabilitiesConstants . UpdateRestrictions ) ;
28
+ _updateRestrictions ? . MergePropertiesIfNull ( complexPropertyUpdateRestrictions ) ;
29
29
_updateRestrictions ??= complexPropertyUpdateRestrictions ;
30
30
}
31
31
@@ -40,7 +40,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
40
40
// OperationId
41
41
if ( Context . Settings . EnableOperationId )
42
42
{
43
- operation . OperationId = EdmModelHelper . GenerateComplexPropertyPathOperationId ( Path , "Update" ) ;
43
+ string prefix = OperationType == OperationType . Patch ? "Update" : "Set" ;
44
+ operation . OperationId = EdmModelHelper . GenerateComplexPropertyPathOperationId ( Path , prefix ) ;
44
45
}
45
46
}
46
47
@@ -101,37 +102,37 @@ protected override void AppendCustomParameters(OpenApiOperation operation)
101
102
102
103
private OpenApiSchema GetOpenApiSchema ( )
103
104
{
104
- var schema = new OpenApiSchema
105
- {
106
- UnresolvedReference = true ,
107
- Reference = new OpenApiReference
108
- {
109
- Type = ReferenceType . Schema ,
110
- Id = ComplexPropertySegment . ComplexType . FullName ( )
111
- }
112
- } ;
113
-
114
- if ( ComplexPropertySegment . Property . Type . IsCollection ( ) )
115
- {
105
+ var schema = new OpenApiSchema
106
+ {
107
+ UnresolvedReference = true ,
108
+ Reference = new OpenApiReference
109
+ {
110
+ Type = ReferenceType . Schema ,
111
+ Id = ComplexPropertySegment . ComplexType . FullName ( )
112
+ }
113
+ } ;
114
+
115
+ if ( ComplexPropertySegment . Property . Type . IsCollection ( ) )
116
+ {
116
117
return new OpenApiSchema
117
118
{
118
119
Type = Constants . ObjectType ,
119
- Properties = new Dictionary < string , OpenApiSchema >
120
- {
121
- {
120
+ Properties = new Dictionary < string , OpenApiSchema >
121
+ {
122
+ {
122
123
"value" ,
123
124
new OpenApiSchema
124
125
{
125
126
Type = "array" ,
126
127
Items = schema
127
- }
128
- }
128
+ }
129
+ }
129
130
}
130
- } ;
131
- }
132
- else
133
- {
134
- return schema ;
131
+ } ;
132
+ }
133
+ else
134
+ {
135
+ return schema ;
135
136
}
136
137
}
137
138
}
0 commit comments