@@ -13,49 +13,26 @@ namespace Microsoft.OpenApi.Models
1313 /// <summary>
1414 /// Path Item Object: to describe the operations available on a single path.
1515 /// </summary>
16- public class OpenApiPathItem : IOpenApiExtensible , IOpenApiReferenceable
16+ public class OpenApiPathItem : IOpenApiExtensible , IOpenApiReferenceable , IOpenApiPathItem
1717 {
18- /// <summary>
19- /// An optional, string summary, intended to apply to all operations in this path.
20- /// </summary>
21- public virtual string Summary { get ; set ; }
18+ /// <inheritdoc/>
19+ public string Summary { get ; set ; }
2220
23- /// <summary>
24- /// An optional, string description, intended to apply to all operations in this path.
25- /// </summary>
26- public virtual string Description { get ; set ; }
21+ /// <inheritdoc/>
22+ public string Description { get ; set ; }
2723
28- /// <summary>
29- /// Gets the definition of operations on this path.
30- /// </summary>
31- public virtual IDictionary < OperationType , OpenApiOperation > Operations { get ; set ; }
24+ /// <inheritdoc/>
25+ public IDictionary < OperationType , OpenApiOperation > Operations { get ; set ; }
3226 = new Dictionary < OperationType , OpenApiOperation > ( ) ;
3327
34- /// <summary>
35- /// An alternative server array to service all operations in this path.
36- /// </summary>
37- public virtual IList < OpenApiServer > Servers { get ; set ; } = new List < OpenApiServer > ( ) ;
38-
39- /// <summary>
40- /// A list of parameters that are applicable for all the operations described under this path.
41- /// These parameters can be overridden at the operation level, but cannot be removed there.
42- /// </summary>
43- public virtual IList < IOpenApiParameter > Parameters { get ; set ; } = new List < IOpenApiParameter > ( ) ;
28+ /// <inheritdoc/>
29+ public IList < OpenApiServer > Servers { get ; set ; } = [ ] ;
4430
45- /// <summary>
46- /// This object MAY be extended with Specification Extensions.
47- /// </summary>
48- public virtual IDictionary < string , IOpenApiExtension > Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
31+ /// <inheritdoc/>
32+ public IList < IOpenApiParameter > Parameters { get ; set ; } = [ ] ;
4933
50- /// <summary>
51- /// Indicates if object is populated with data or is just a reference to the data
52- /// </summary>
53- public bool UnresolvedReference { get ; set ; }
54-
55- /// <summary>
56- /// Reference object.
57- /// </summary>
58- public OpenApiReference Reference { get ; set ; }
34+ /// <inheritdoc/>
35+ public IDictionary < string , IOpenApiExtension > Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
5936
6037 /// <summary>
6138 /// Add one operation into this path item.
@@ -75,30 +52,29 @@ public OpenApiPathItem() { }
7552 /// <summary>
7653 /// Initializes a clone of an <see cref="OpenApiPathItem"/> object
7754 /// </summary>
78- public OpenApiPathItem ( OpenApiPathItem pathItem )
55+ public OpenApiPathItem ( IOpenApiPathItem pathItem )
7956 {
57+ Utils . CheckArgumentNull ( pathItem ) ;
8058 Summary = pathItem ? . Summary ?? Summary ;
8159 Description = pathItem ? . Description ?? Description ;
8260 Operations = pathItem ? . Operations != null ? new Dictionary < OperationType , OpenApiOperation > ( pathItem . Operations ) : null ;
8361 Servers = pathItem ? . Servers != null ? new List < OpenApiServer > ( pathItem . Servers ) : null ;
8462 Parameters = pathItem ? . Parameters != null ? new List < IOpenApiParameter > ( pathItem . Parameters ) : null ;
8563 Extensions = pathItem ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( pathItem . Extensions ) : null ;
86- UnresolvedReference = pathItem ? . UnresolvedReference ?? UnresolvedReference ;
87- Reference = pathItem ? . Reference != null ? new ( pathItem ? . Reference ) : null ;
8864 }
8965
9066 /// <summary>
9167 /// Serialize <see cref="OpenApiPathItem"/> to Open Api v3.1
9268 /// </summary>
93- public virtual void SerializeAsV31 ( IOpenApiWriter writer )
69+ public void SerializeAsV31 ( IOpenApiWriter writer )
9470 {
9571 SerializeInternal ( writer , OpenApiSpecVersion . OpenApi3_1 , ( writer , element ) => element . SerializeAsV31 ( writer ) ) ;
9672 }
9773
9874 /// <summary>
9975 /// Serialize <see cref="OpenApiPathItem"/> to Open Api v3.0
10076 /// </summary>
101- public virtual void SerializeAsV3 ( IOpenApiWriter writer )
77+ public void SerializeAsV3 ( IOpenApiWriter writer )
10278 {
10379 SerializeInternal ( writer , OpenApiSpecVersion . OpenApi3_0 , ( writer , element ) => element . SerializeAsV3 ( writer ) ) ;
10480 }
0 commit comments