8
8
using Microsoft . OpenApi . Models . References ;
9
9
using Microsoft . OpenApi . Writers ;
10
10
11
+ #nullable enable
12
+
11
13
namespace Microsoft . OpenApi . Models
12
14
{
13
15
/// <summary>
@@ -24,51 +26,51 @@ public class OpenApiOperation : IOpenApiSerializable, IOpenApiExtensible
24
26
/// A list of tags for API documentation control.
25
27
/// Tags can be used for logical grouping of operations by resources or any other qualifier.
26
28
/// </summary>
27
- public IList < OpenApiTag > Tags { get ; set ; } = new List < OpenApiTag > ( ) ;
29
+ public IList < OpenApiTag > ? Tags { get ; set ; } = new List < OpenApiTag > ( ) ;
28
30
29
31
/// <summary>
30
32
/// A short summary of what the operation does.
31
33
/// </summary>
32
- public string Summary { get ; set ; }
34
+ public string ? Summary { get ; set ; }
33
35
34
36
/// <summary>
35
37
/// A verbose explanation of the operation behavior.
36
38
/// CommonMark syntax MAY be used for rich text representation.
37
39
/// </summary>
38
- public string Description { get ; set ; }
40
+ public string ? Description { get ; set ; }
39
41
40
42
/// <summary>
41
43
/// Additional external documentation for this operation.
42
44
/// </summary>
43
- public OpenApiExternalDocs ExternalDocs { get ; set ; }
45
+ public OpenApiExternalDocs ? ExternalDocs { get ; set ; }
44
46
45
47
/// <summary>
46
48
/// Unique string used to identify the operation. The id MUST be unique among all operations described in the API.
47
49
/// Tools and libraries MAY use the operationId to uniquely identify an operation, therefore,
48
50
/// it is RECOMMENDED to follow common programming naming conventions.
49
51
/// </summary>
50
- public string OperationId { get ; set ; }
52
+ public string ? OperationId { get ; set ; }
51
53
52
54
/// <summary>
53
55
/// A list of parameters that are applicable for this operation.
54
56
/// If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
55
57
/// The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location.
56
58
/// The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
57
59
/// </summary>
58
- public IList < OpenApiParameter > Parameters { get ; set ; } = new List < OpenApiParameter > ( ) ;
60
+ public IList < OpenApiParameter > ? Parameters { get ; set ; } = new List < OpenApiParameter > ( ) ;
59
61
60
62
/// <summary>
61
63
/// The request body applicable for this operation.
62
64
/// The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231
63
65
/// has explicitly defined semantics for request bodies.
64
66
/// In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
65
67
/// </summary>
66
- public OpenApiRequestBody RequestBody { get ; set ; }
68
+ public OpenApiRequestBody ? RequestBody { get ; set ; }
67
69
68
70
/// <summary>
69
71
/// REQUIRED. The list of possible responses as they are returned from executing this operation.
70
72
/// </summary>
71
- public OpenApiResponses Responses { get ; set ; } = new ( ) ;
73
+ public OpenApiResponses ? Responses { get ; set ; } = new ( ) ;
72
74
73
75
/// <summary>
74
76
/// A map of possible out-of band callbacks related to the parent operation.
@@ -78,7 +80,7 @@ public class OpenApiOperation : IOpenApiSerializable, IOpenApiExtensible
78
80
/// The key value used to identify the callback object is an expression, evaluated at runtime,
79
81
/// that identifies a URL to use for the callback operation.
80
82
/// </summary>
81
- public IDictionary < string , OpenApiCallback > Callbacks { get ; set ; } = new Dictionary < string , OpenApiCallback > ( ) ;
83
+ public IDictionary < string , OpenApiCallback > ? Callbacks { get ; set ; } = new Dictionary < string , OpenApiCallback > ( ) ;
82
84
83
85
/// <summary>
84
86
/// Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation.
@@ -92,19 +94,19 @@ public class OpenApiOperation : IOpenApiSerializable, IOpenApiExtensible
92
94
/// This definition overrides any declared top-level security.
93
95
/// To remove a top-level security declaration, an empty array can be used.
94
96
/// </summary>
95
- public IList < OpenApiSecurityRequirement > Security { get ; set ; } = new List < OpenApiSecurityRequirement > ( ) ;
97
+ public IList < OpenApiSecurityRequirement > ? Security { get ; set ; } = new List < OpenApiSecurityRequirement > ( ) ;
96
98
97
99
/// <summary>
98
100
/// An alternative server array to service this operation.
99
101
/// If an alternative server object is specified at the Path Item Object or Root level,
100
102
/// it will be overridden by this value.
101
103
/// </summary>
102
- public IList < OpenApiServer > Servers { get ; set ; } = new List < OpenApiServer > ( ) ;
104
+ public IList < OpenApiServer > ? Servers { get ; set ; } = new List < OpenApiServer > ( ) ;
103
105
104
106
/// <summary>
105
107
/// This object MAY be extended with Specification Extensions.
106
108
/// </summary>
107
- public IDictionary < string , IOpenApiExtension > Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
109
+ public IDictionary < string , IOpenApiExtension > ? Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
108
110
109
111
/// <summary>
110
112
/// Parameterless constructor
@@ -114,9 +116,9 @@ public OpenApiOperation() { }
114
116
/// <summary>
115
117
/// Initializes a copy of an <see cref="OpenApiOperation"/> object
116
118
/// </summary>
117
- public OpenApiOperation ( OpenApiOperation operation )
119
+ public OpenApiOperation ( OpenApiOperation ? operation )
118
120
{
119
- Tags = operation ? . Tags != null ? new List < OpenApiTag > ( operation ? . Tags ) : null ;
121
+ Tags = operation ? . Tags != null ? new List < OpenApiTag > ( operation . Tags ) : null ;
120
122
Summary = operation ? . Summary ?? Summary ;
121
123
Description = operation ? . Description ?? Description ;
122
124
ExternalDocs = operation ? . ExternalDocs != null ? new ( operation ? . ExternalDocs ) : null ;
0 commit comments