Skip to content

Commit

Permalink
fix: adds missing null propagation operators for callback and header …
Browse files Browse the repository at this point in the history
…references

Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Jan 24, 2025
1 parent aa80b19 commit 0cb4ccb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ internal OpenApiCallbackReference(OpenApiCallback target, string referenceId)
}

/// <inheritdoc/>
public Dictionary<RuntimeExpression, OpenApiPathItem> PathItems { get => Target.PathItems; }
public Dictionary<RuntimeExpression, OpenApiPathItem> PathItems { get => Target?.PathItems; }

/// <inheritdoc/>
public IDictionary<string, IOpenApiExtension> Extensions { get => Target.Extensions; }
public IDictionary<string, IOpenApiExtension> Extensions { get => Target?.Extensions; }

/// <inheritdoc/>
public void SerializeAsV3(IOpenApiWriter writer)
Expand Down
22 changes: 11 additions & 11 deletions src/Microsoft.OpenApi/Models/References/OpenApiHeaderReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,37 +97,37 @@ public string Description
}

/// <inheritdoc/>
public bool Required { get => Target.Required; }
public bool Required { get => Target?.Required ?? default; }

/// <inheritdoc/>
public bool Deprecated { get => Target.Deprecated; }
public bool Deprecated { get => Target?.Deprecated ?? default; }

/// <inheritdoc/>
public bool AllowEmptyValue { get => Target.AllowEmptyValue; }
public bool AllowEmptyValue { get => Target?.AllowEmptyValue ?? default; }

/// <inheritdoc/>
public OpenApiSchema Schema { get => Target.Schema; }
public OpenApiSchema Schema { get => Target?.Schema; }

/// <inheritdoc/>
public ParameterStyle? Style { get => Target.Style; }
public ParameterStyle? Style { get => Target?.Style; }

/// <inheritdoc/>
public bool Explode { get => Target.Explode; }
public bool Explode { get => Target?.Explode ?? default; }

/// <inheritdoc/>
public bool AllowReserved { get => Target.AllowReserved; }
public bool AllowReserved { get => Target?.AllowReserved ?? default; }

/// <inheritdoc/>
public JsonNode Example { get => Target.Example; }
public JsonNode Example { get => Target?.Example; }

/// <inheritdoc/>
public IDictionary<string, IOpenApiExample> Examples { get => Target.Examples; }
public IDictionary<string, IOpenApiExample> Examples { get => Target?.Examples; }

/// <inheritdoc/>
public IDictionary<string, OpenApiMediaType> Content { get => Target.Content; }
public IDictionary<string, OpenApiMediaType> Content { get => Target?.Content; }

/// <inheritdoc/>
public IDictionary<string, IOpenApiExtension> Extensions { get => Target.Extensions; }
public IDictionary<string, IOpenApiExtension> Extensions { get => Target?.Extensions; }

/// <inheritdoc/>
public void SerializeAsV31(IOpenApiWriter writer)
Expand Down

0 comments on commit 0cb4ccb

Please sign in to comment.