- renames dollar count segment setting

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
This commit is contained in:
Vincent Biret 2021-11-23 14:01:38 -05:00
parent a8bb14f26e
commit 00b605f9fc
No known key found for this signature in database
GPG Key ID: 32426322EDFFB7E3
5 changed files with 7 additions and 7 deletions

View File

@ -387,7 +387,7 @@ namespace Microsoft.OpenApi.OData.Edm
{
if(currentPath == null) throw new ArgumentNullException(nameof(currentPath));
if(convertSettings == null) throw new ArgumentNullException(nameof(convertSettings));
if(!convertSettings.IncludeDollarCountPathSegments) return;
if(!convertSettings.EnableDollarCountPath) return;
var countPath = currentPath.Clone();
countPath.Push(ODataDollarCountSegment.Instance);
AppendPath(countPath);

View File

@ -67,7 +67,7 @@ namespace Microsoft.OpenApi.OData.Generator
schemas[schema.Key] = schema.Value;
}
if(context.Settings.IncludeDollarCountPathSegments)
if(context.Settings.EnableDollarCountPath)
schemas[Constants.DollarCountSchemaName] = new OpenApiSchema {
Type = "integer",
Format = "int32"

View File

@ -186,7 +186,7 @@ namespace Microsoft.OpenApi.OData
/// <summary>
/// Gets/sets a value indicating whether or not add OData $count segments in the description for collections.
/// </summary>
public bool IncludeDollarCountPathSegments { get; set; } = true;
public bool EnableDollarCountPath { get; set; } = true;
internal OpenApiConvertSettings Clone()
{
@ -218,7 +218,7 @@ namespace Microsoft.OpenApi.OData
ShowSchemaExamples = this.ShowSchemaExamples,
ShowRootPath = this.ShowRootPath,
PathProvider = this.PathProvider,
IncludeDollarCountPathSegments = this.IncludeDollarCountPathSegments,
EnableDollarCountPath = this.EnableDollarCountPath,
};
return newSettings;

View File

@ -128,8 +128,8 @@ Microsoft.OpenApi.OData.OpenApiConvertSettings.PathPrefix.get -> string
Microsoft.OpenApi.OData.OpenApiConvertSettings.PathPrefix.set -> void
Microsoft.OpenApi.OData.OpenApiConvertSettings.PathProvider.get -> Microsoft.OpenApi.OData.Edm.IODataPathProvider
Microsoft.OpenApi.OData.OpenApiConvertSettings.PathProvider.set -> void
Microsoft.OpenApi.OData.OpenApiConvertSettings.IncludeDollarCountPathSegments.get -> bool
Microsoft.OpenApi.OData.OpenApiConvertSettings.IncludeDollarCountPathSegments.set -> void
Microsoft.OpenApi.OData.OpenApiConvertSettings.EnableDollarCountPath.get -> bool
Microsoft.OpenApi.OData.OpenApiConvertSettings.EnableDollarCountPath.set -> void
Microsoft.OpenApi.OData.OpenApiConvertSettings.PrefixEntityTypeNameBeforeKey.get -> bool
Microsoft.OpenApi.OData.OpenApiConvertSettings.PrefixEntityTypeNameBeforeKey.set -> void
Microsoft.OpenApi.OData.OpenApiConvertSettings.RequireDerivedTypesConstraintForBoundOperations.get -> bool

View File

@ -93,7 +93,7 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
IEdmModel model = GetInheritanceModel(string.Empty);
ODataPathProvider provider = new ODataPathProvider();
var settings = new OpenApiConvertSettings {
IncludeDollarCountPathSegments = false,
EnableDollarCountPath = false,
};
// Act