Skip to content

Commit 8d57b81

Browse files
committed
fix: aligns to null propagation operator
Signed-off-by: Vincent Biret <[email protected]>
1 parent e3325b9 commit 8d57b81

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

src/Microsoft.OpenApi/Models/References/OpenApiSchemaReference.cs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -118,59 +118,59 @@ internal OpenApiSchemaReference(OpenApiSchema target, string referenceId)
118118
/// <inheritdoc/>
119119
public override string Title { get => string.IsNullOrEmpty(_title) ? Target?.Title : _title; set => _title = value; }
120120
/// <inheritdoc/>
121-
public override string Schema { get => string.IsNullOrEmpty(_schema) ? Target.Schema : _schema; set => _schema = value; }
121+
public override string Schema { get => string.IsNullOrEmpty(_schema) ? Target?.Schema : _schema; set => _schema = value; }
122122
/// <inheritdoc/>
123-
public override string Id { get => string.IsNullOrEmpty(_id) ? Target.Id : _id; set => _id = value; }
123+
public override string Id { get => string.IsNullOrEmpty(_id) ? Target?.Id : _id; set => _id = value; }
124124
/// <inheritdoc/>
125-
public override string Comment { get => string.IsNullOrEmpty(_comment) ? Target.Comment : _comment; set => _comment = value; }
125+
public override string Comment { get => string.IsNullOrEmpty(_comment) ? Target?.Comment : _comment; set => _comment = value; }
126126
/// <inheritdoc/>
127127
public override IDictionary<string, bool> Vocabulary { get => _vocabulary is not null ? _vocabulary : Target?.Vocabulary; set => _vocabulary = value; }
128128
/// <inheritdoc/>
129-
public override string DynamicRef { get => string.IsNullOrEmpty(_dynamicRef) ? Target.DynamicRef : _dynamicRef; set => _dynamicRef = value; }
129+
public override string DynamicRef { get => string.IsNullOrEmpty(_dynamicRef) ? Target?.DynamicRef : _dynamicRef; set => _dynamicRef = value; }
130130
/// <inheritdoc/>
131-
public override string DynamicAnchor { get => string.IsNullOrEmpty(_dynamicAnchor) ? Target.DynamicAnchor : _dynamicAnchor; set => _dynamicAnchor = value; }
131+
public override string DynamicAnchor { get => string.IsNullOrEmpty(_dynamicAnchor) ? Target?.DynamicAnchor : _dynamicAnchor; set => _dynamicAnchor = value; }
132132
/// <inheritdoc/>
133133
public override IDictionary<string, OpenApiSchema> Definitions { get => _definitions is not null ? _definitions : Target?.Definitions; set => _definitions = value; }
134134
/// <inheritdoc/>
135-
public override decimal? V31ExclusiveMaximum { get => _v31ExclusiveMaximum is not null ? _v31ExclusiveMaximum.Value : Target.V31ExclusiveMaximum; set => _v31ExclusiveMaximum = value; }
135+
public override decimal? V31ExclusiveMaximum { get => _v31ExclusiveMaximum is not null ? _v31ExclusiveMaximum.Value : Target?.V31ExclusiveMaximum; set => _v31ExclusiveMaximum = value; }
136136
/// <inheritdoc/>
137-
public override decimal? V31ExclusiveMinimum { get => _v31ExclusiveMinimum is not null ? _v31ExclusiveMinimum.Value : Target.V31ExclusiveMinimum; set => _v31ExclusiveMinimum = value; }
137+
public override decimal? V31ExclusiveMinimum { get => _v31ExclusiveMinimum is not null ? _v31ExclusiveMinimum.Value : Target?.V31ExclusiveMinimum; set => _v31ExclusiveMinimum = value; }
138138
/// <inheritdoc/>
139-
public override bool UnEvaluatedProperties { get => _unEvaluatedProperties is not null ? _unEvaluatedProperties.Value : Target.UnEvaluatedProperties; set => _unEvaluatedProperties = value; }
139+
public override bool UnEvaluatedProperties { get => _unEvaluatedProperties is not null ? _unEvaluatedProperties.Value : Target?.UnEvaluatedProperties ?? false; set => _unEvaluatedProperties = value; }
140140
/// <inheritdoc/>
141-
public override JsonSchemaType? Type { get => _type is not null ? _type.Value : Target.Type; set => _type = value; }
141+
public override JsonSchemaType? Type { get => _type is not null ? _type.Value : Target?.Type; set => _type = value; }
142142
/// <inheritdoc/>
143-
public override string Const { get => string.IsNullOrEmpty(_const) ? Target.Const : _const; set => _const = value; }
143+
public override string Const { get => string.IsNullOrEmpty(_const) ? Target?.Const : _const; set => _const = value; }
144144
/// <inheritdoc/>
145-
public override string Format { get => string.IsNullOrEmpty(_format) ? Target.Format : _format; set => _format = value; }
145+
public override string Format { get => string.IsNullOrEmpty(_format) ? Target?.Format : _format; set => _format = value; }
146146
/// <inheritdoc/>
147147
public override string Description
148148
{
149-
get => string.IsNullOrEmpty(_description) ? Target.Description : _description;
149+
get => string.IsNullOrEmpty(_description) ? Target?.Description : _description;
150150
set => _description = value;
151151
}
152152
/// <inheritdoc/>
153-
public override decimal? Maximum { get => _maximum is not null ? _maximum : Target.Maximum; set => _maximum = value; }
153+
public override decimal? Maximum { get => _maximum is not null ? _maximum : Target?.Maximum; set => _maximum = value; }
154154
/// <inheritdoc/>
155-
public override bool? ExclusiveMaximum { get => _exclusiveMaximum is not null ? _exclusiveMaximum : Target.ExclusiveMaximum; set => _exclusiveMaximum = value; }
155+
public override bool? ExclusiveMaximum { get => _exclusiveMaximum is not null ? _exclusiveMaximum : Target?.ExclusiveMaximum; set => _exclusiveMaximum = value; }
156156
/// <inheritdoc/>
157-
public override decimal? Minimum { get => _minimum is not null ? _minimum : Target.Minimum; set => _minimum = value; }
157+
public override decimal? Minimum { get => _minimum is not null ? _minimum : Target?.Minimum; set => _minimum = value; }
158158
/// <inheritdoc/>
159-
public override bool? ExclusiveMinimum { get => _exclusiveMinimum is not null ? _exclusiveMinimum : Target.ExclusiveMinimum; set => _exclusiveMinimum = value; }
159+
public override bool? ExclusiveMinimum { get => _exclusiveMinimum is not null ? _exclusiveMinimum : Target?.ExclusiveMinimum; set => _exclusiveMinimum = value; }
160160
/// <inheritdoc/>
161-
public override int? MaxLength { get => _maxLength is not null ? _maxLength : Target.MaxLength; set => _maxLength = value; }
161+
public override int? MaxLength { get => _maxLength is not null ? _maxLength : Target?.MaxLength; set => _maxLength = value; }
162162
/// <inheritdoc/>
163-
public override int? MinLength { get => _minLength is not null ? _minLength : Target.MinLength; set => _minLength = value; }
163+
public override int? MinLength { get => _minLength is not null ? _minLength : Target?.MinLength; set => _minLength = value; }
164164
/// <inheritdoc/>
165-
public override string Pattern { get => string.IsNullOrEmpty(_pattern) ? Target.Pattern : _pattern; set => _pattern = value; }
165+
public override string Pattern { get => string.IsNullOrEmpty(_pattern) ? Target?.Pattern : _pattern; set => _pattern = value; }
166166
/// <inheritdoc/>
167-
public override decimal? MultipleOf { get => _multipleOf is not null ? _multipleOf : Target.MultipleOf; set => _multipleOf = value; }
167+
public override decimal? MultipleOf { get => _multipleOf is not null ? _multipleOf : Target?.MultipleOf; set => _multipleOf = value; }
168168
/// <inheritdoc/>
169-
public override JsonNode Default { get => _default is not null ? _default : Target.Default; set => _default = value; }
169+
public override JsonNode Default { get => _default is not null ? _default : Target?.Default; set => _default = value; }
170170
/// <inheritdoc/>
171-
public override bool ReadOnly { get => _readOnly is not null ? _readOnly.Value : Target.ReadOnly; set => _readOnly = value; }
171+
public override bool ReadOnly { get => _readOnly is not null ? _readOnly.Value : Target?.ReadOnly ?? false; set => _readOnly = value; }
172172
/// <inheritdoc/>
173-
public override bool WriteOnly { get => _writeOnly is not null ? _writeOnly.Value : Target.WriteOnly; set => _writeOnly = value; }
173+
public override bool WriteOnly { get => _writeOnly is not null ? _writeOnly.Value : Target?.WriteOnly ?? false; set => _writeOnly = value; }
174174
/// <inheritdoc/>
175175
public override IList<OpenApiSchema> AllOf { get => _allOf is not null ? _allOf : Target?.AllOf; set => _allOf = value; }
176176
/// <inheritdoc/>
@@ -184,41 +184,41 @@ public override string Description
184184
/// <inheritdoc/>
185185
public override OpenApiSchema Items { get => _items is not null ? _items : Target?.Items; set => _items = value; }
186186
/// <inheritdoc/>
187-
public override int? MaxItems { get => _maxItems is not null ? _maxItems : Target.MaxItems; set => _maxItems = value; }
187+
public override int? MaxItems { get => _maxItems is not null ? _maxItems : Target?.MaxItems; set => _maxItems = value; }
188188
/// <inheritdoc/>
189-
public override int? MinItems { get => _minItems is not null ? _minItems : Target.MinItems; set => _minItems = value; }
189+
public override int? MinItems { get => _minItems is not null ? _minItems : Target?.MinItems; set => _minItems = value; }
190190
/// <inheritdoc/>
191-
public override bool? UniqueItems { get => _uniqueItems is not null ? _uniqueItems : Target.UniqueItems; set => _uniqueItems = value; }
191+
public override bool? UniqueItems { get => _uniqueItems is not null ? _uniqueItems : Target?.UniqueItems; set => _uniqueItems = value; }
192192
/// <inheritdoc/>
193193
public override IDictionary<string, OpenApiSchema> Properties { get => _properties is not null ? _properties : Target?.Properties ; set => _properties = value; }
194194
/// <inheritdoc/>
195195
public override IDictionary<string, OpenApiSchema> PatternProperties { get => _patternProperties is not null ? _patternProperties : Target?.PatternProperties; set => _patternProperties = value; }
196196
/// <inheritdoc/>
197-
public override int? MaxProperties { get => _maxProperties is not null ? _maxProperties : Target.MaxProperties; set => _maxProperties = value; }
197+
public override int? MaxProperties { get => _maxProperties is not null ? _maxProperties : Target?.MaxProperties; set => _maxProperties = value; }
198198
/// <inheritdoc/>
199-
public override int? MinProperties { get => _minProperties is not null ? _minProperties : Target.MinProperties; set => _minProperties = value; }
199+
public override int? MinProperties { get => _minProperties is not null ? _minProperties : Target?.MinProperties; set => _minProperties = value; }
200200
/// <inheritdoc/>
201-
public override bool AdditionalPropertiesAllowed { get => _additionalPropertiesAllowed is not null ? _additionalPropertiesAllowed.Value : Target.AdditionalPropertiesAllowed; set => _additionalPropertiesAllowed = value; }
201+
public override bool AdditionalPropertiesAllowed { get => _additionalPropertiesAllowed is not null ? _additionalPropertiesAllowed.Value : Target?.AdditionalPropertiesAllowed ?? true; set => _additionalPropertiesAllowed = value; }
202202
/// <inheritdoc/>
203203
public override OpenApiSchema AdditionalProperties { get => _additionalProperties is not null ? _additionalProperties : Target?.AdditionalProperties; set => _additionalProperties = value; }
204204
/// <inheritdoc/>
205-
public override OpenApiDiscriminator Discriminator { get => _discriminator is not null ? _discriminator : Target.Discriminator; set => _discriminator = value; }
205+
public override OpenApiDiscriminator Discriminator { get => _discriminator is not null ? _discriminator : Target?.Discriminator; set => _discriminator = value; }
206206
/// <inheritdoc/>
207-
public override JsonNode Example { get => _example is not null ? _example : Target.Example; set => _example = value; }
207+
public override JsonNode Example { get => _example is not null ? _example : Target?.Example; set => _example = value; }
208208
/// <inheritdoc/>
209209
public override IList<JsonNode> Examples { get => _examples is not null ? _examples : Target?.Examples; set => _examples = value; }
210210
/// <inheritdoc/>
211211
public override IList<JsonNode> Enum { get => _enum is not null ? _enum : Target?.Enum; set => _enum = value; }
212212
/// <inheritdoc/>
213-
public override bool Nullable { get => _nullable is null ? Target.Nullable : _nullable.Value; set => _nullable = value; }
213+
public override bool Nullable { get => _nullable is not null ? _nullable.Value : Target?.Nullable ?? false; set => _nullable = value; }
214214
/// <inheritdoc/>
215-
public override bool UnevaluatedProperties { get => _unevaluatedProperties is not null ? _unevaluatedProperties.Value : Target.UnevaluatedProperties; set => _unevaluatedProperties = value; }
215+
public override bool UnevaluatedProperties { get => _unevaluatedProperties is not null ? _unevaluatedProperties.Value : Target?.UnevaluatedProperties ?? false; set => _unevaluatedProperties = value; }
216216
/// <inheritdoc/>
217217
public override OpenApiExternalDocs ExternalDocs { get => _externalDocs is not null ? _externalDocs : Target?.ExternalDocs; set => _externalDocs = value; }
218218
/// <inheritdoc/>
219-
public override bool Deprecated { get => _deprecated is not null ? _deprecated.Value : Target.Deprecated; set => _deprecated = value; }
219+
public override bool Deprecated { get => _deprecated is not null ? _deprecated.Value : Target?.Deprecated ?? false; set => _deprecated = value; }
220220
/// <inheritdoc/>
221-
public override OpenApiXml Xml { get => _xml is not null ? _xml : Target.Xml; set => _xml = value; }
221+
public override OpenApiXml Xml { get => _xml is not null ? _xml : Target?.Xml; set => _xml = value; }
222222
/// <inheritdoc/>
223223
public override IDictionary<string, IOpenApiExtension> Extensions { get => _extensions is not null ? _extensions : Target?.Extensions; set => _extensions = value; }
224224

0 commit comments

Comments
 (0)