- 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(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);
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue