@@ -23,9 +23,9 @@ protected override void Initialize(ODataContext context, ODataPath path)
2323 {
2424 base . Initialize ( context , path ) ;
2525
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 ) ;
2929 _updateRestrictions ??= complexPropertyUpdateRestrictions ;
3030 }
3131
@@ -40,7 +40,8 @@ protected override void SetBasicInfo(OpenApiOperation operation)
4040 // OperationId
4141 if ( Context . Settings . EnableOperationId )
4242 {
43- operation . OperationId = EdmModelHelper . GenerateComplexPropertyPathOperationId ( Path , "Update" ) ;
43+ string prefix = OperationType == OperationType . Patch ? "Update" : "Set" ;
44+ operation . OperationId = EdmModelHelper . GenerateComplexPropertyPathOperationId ( Path , prefix ) ;
4445 }
4546 }
4647
@@ -101,37 +102,37 @@ protected override void AppendCustomParameters(OpenApiOperation operation)
101102
102103 private OpenApiSchema GetOpenApiSchema ( )
103104 {
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+ {
116117 return new OpenApiSchema
117118 {
118119 Type = Constants . ObjectType ,
119- Properties = new Dictionary < string , OpenApiSchema >
120- {
121- {
120+ Properties = new Dictionary < string , OpenApiSchema >
121+ {
122+ {
122123 "value" ,
123124 new OpenApiSchema
124125 {
125126 Type = "array" ,
126127 Items = schema
127- }
128- }
128+ }
129+ }
129130 }
130- } ;
131- }
132- else
133- {
134- return schema ;
131+ } ;
132+ }
133+ else
134+ {
135+ return schema ;
135136 }
136137 }
137138}
0 commit comments