- renames dollar count segment setting
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
This commit is contained in:
parent
a8bb14f26e
commit
00b605f9fc
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue