- 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(currentPath == null) throw new ArgumentNullException(nameof(currentPath));
if(convertSettings == null) throw new ArgumentNullException(nameof(convertSettings)); if(convertSettings == null) throw new ArgumentNullException(nameof(convertSettings));
if(!convertSettings.IncludeDollarCountPathSegments) return; if(!convertSettings.EnableDollarCountPath) return;
var countPath = currentPath.Clone(); var countPath = currentPath.Clone();
countPath.Push(ODataDollarCountSegment.Instance); countPath.Push(ODataDollarCountSegment.Instance);
AppendPath(countPath); AppendPath(countPath);

View file

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

View file

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

View file

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