@@ -120,22 +120,23 @@ public OpenApiOperation() { }
120120 /// <summary>
121121 /// Initializes a copy of an <see cref="OpenApiOperation"/> object
122122 /// </summary>
123- public OpenApiOperation ( OpenApiOperation ? operation )
123+ public OpenApiOperation ( OpenApiOperation operation )
124124 {
125- Tags = operation ? . Tags != null ? new List < OpenApiTagReference > ( operation . Tags ) : null ;
126- Summary = operation ? . Summary ?? Summary ;
127- Description = operation ? . Description ?? Description ;
128- ExternalDocs = operation ? . ExternalDocs != null ? new ( operation ? . ExternalDocs ) : null ;
129- OperationId = operation ? . OperationId ?? OperationId ;
130- Parameters = operation ? . Parameters != null ? new List < IOpenApiParameter > ( operation . Parameters ) : null ;
131- RequestBody = operation ? . RequestBody != null ? new OpenApiRequestBody ( operation ? . RequestBody ) : null ;
132- Responses = operation ? . Responses != null ? new ( operation ? . Responses ) : null ;
133- Callbacks = operation ? . Callbacks != null ? new Dictionary < string , IOpenApiCallback > ( operation . Callbacks ) : null ;
134- Deprecated = operation ? . Deprecated ?? Deprecated ;
135- Security = operation ? . Security != null ? new List < OpenApiSecurityRequirement > ( operation . Security ) : null ;
136- Servers = operation ? . Servers != null ? new List < OpenApiServer > ( operation . Servers ) : null ;
137- Extensions = operation ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( operation . Extensions ) : null ;
138- Annotations = operation ? . Annotations != null ? new Dictionary < string , object > ( operation . Annotations ) : null ;
125+ Utils . CheckArgumentNull ( operation ) ;
126+ Tags = operation . Tags != null ? new List < OpenApiTagReference > ( operation . Tags ) : null ;
127+ Summary = operation . Summary ?? Summary ;
128+ Description = operation . Description ?? Description ;
129+ ExternalDocs = operation . ExternalDocs != null ? new ( operation . ExternalDocs ) : null ;
130+ OperationId = operation . OperationId ?? OperationId ;
131+ Parameters = operation . Parameters != null ? new List < IOpenApiParameter > ( operation . Parameters ) : null ;
132+ RequestBody = operation . RequestBody ? . CreateShallowCopy ( ) ;
133+ Responses = operation . Responses != null ? new ( operation . Responses ) : null ;
134+ Callbacks = operation . Callbacks != null ? new Dictionary < string , IOpenApiCallback > ( operation . Callbacks ) : null ;
135+ Deprecated = operation . Deprecated ;
136+ Security = operation . Security != null ? new List < OpenApiSecurityRequirement > ( operation . Security ) : null ;
137+ Servers = operation . Servers != null ? new List < OpenApiServer > ( operation . Servers ) : null ;
138+ Extensions = operation . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( operation . Extensions ) : null ;
139+ Annotations = operation . Annotations != null ? new Dictionary < string , object > ( operation . Annotations ) : null ;
139140 }
140141
141142 /// <summary>
0 commit comments