Skip to content

Commit

Permalink
Update OpenApiConvertSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
millicentachieng committed Oct 5, 2022
1 parent 7bb7d7e commit e26a0d7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ namespace Microsoft.OpenApi.OData
/// </summary>
public class OpenApiConvertSettings
{
private bool _enableODataAnnotationReferencesForResponses = true;

/// <summary>
/// Gets/sets the service root.
/// </summary>
Expand Down Expand Up @@ -110,18 +108,13 @@ public class OpenApiConvertSettings
/// <summary>
/// Gets/sets a value indicating whether or not to reference @odata.nextLink and @odata.count in responses
/// </summary>
[Obsolete("Deprecated in favor of EnableODataAnnotationReferencesForResponses. " +
"When both are provided, EnableODataAnnotationReferencesForResponses takes precedence.")]
public bool RefBaseCollectionPaginationCountResponse { get; set; } = true;
[Obsolete("Deprecated in favor of EnableODataAnnotationReferencesForResponses.")]
public bool RefBaseCollectionPaginationCountResponse { get { return EnableODataAnnotationReferencesForResponses; } }

/// <summary>
/// Gets/sets a value indicating whether or not to reference @odata.nextLink, @odata.deltaLink and @odata.count in responses
/// </summary>
public bool EnableODataAnnotationReferencesForResponses
{
get => _enableODataAnnotationReferencesForResponses;
set => _enableODataAnnotationReferencesForResponses = value && this.RefBaseCollectionPaginationCountResponse;
}
public bool EnableODataAnnotationReferencesForResponses { get; set; } = true;

/// <summary>
/// Gets/sets a value that specifies the name of the operation for retrieving the next page in a collection of entities.
Expand Down Expand Up @@ -356,7 +349,6 @@ internal OpenApiConvertSettings Clone()
EnableCount = this.EnableCount,
IncludeAssemblyInfo = this.IncludeAssemblyInfo,
EnableODataAnnotationReferencesForResponses = this.EnableODataAnnotationReferencesForResponses,
RefBaseCollectionPaginationCountResponse = this.RefBaseCollectionPaginationCountResponse
};

return newSettings;
Expand Down

0 comments on commit e26a0d7

Please sign in to comment.