- code linting
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
This commit is contained in:
parent
70aefe98a1
commit
960b31b350
|
@ -146,8 +146,8 @@ namespace Microsoft.OpenApi.OData.Edm
|
|||
|
||||
// From Open API spec, parameter name is case sensitive, so don't use the IgnoreCase HashSet.
|
||||
// HashSet<string> parameters = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
HashSet<string> parameters = new HashSet<string>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HashSet<string> parameters = new();
|
||||
StringBuilder sb = new();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(settings.PathPrefix))
|
||||
{
|
||||
|
|
|
@ -42,21 +42,20 @@ namespace Microsoft.OpenApi.OData
|
|||
|
||||
if (settings.VerifyEdmModel)
|
||||
{
|
||||
IEnumerable<EdmError> errors;
|
||||
if (!model.Validate(out errors))
|
||||
{
|
||||
OpenApiDocument document = new OpenApiDocument();
|
||||
int index = 1;
|
||||
foreach (var error in errors)
|
||||
{
|
||||
document.Extensions.Add(Constants.xMsEdmModelError + index++, new OpenApiString(error.ToString()));
|
||||
}
|
||||
if (!model.Validate(out var errors))
|
||||
{
|
||||
OpenApiDocument document = new();
|
||||
int index = 1;
|
||||
foreach (var error in errors)
|
||||
{
|
||||
document.Extensions.Add(Constants.xMsEdmModelError + index++, new OpenApiString(error.ToString()));
|
||||
}
|
||||
|
||||
return document;
|
||||
}
|
||||
}
|
||||
return document;
|
||||
}
|
||||
}
|
||||
|
||||
ODataContext context = new ODataContext(model, settings);
|
||||
ODataContext context = new(model, settings);
|
||||
return context.CreateDocument();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace Microsoft.OpenApi.OData.Generator
|
|||
|
||||
if (settings.ShowRootPath)
|
||||
{
|
||||
OpenApiPathItem rootPath = new OpenApiPathItem()
|
||||
OpenApiPathItem rootPath = new()
|
||||
{
|
||||
Operations = new Dictionary<OperationType, OpenApiOperation> {
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft.OpenApi.OData.PathItem
|
|||
/// </summary>
|
||||
internal class PathItemHandlerProvider : IPathItemHandlerProvider
|
||||
{
|
||||
private IDictionary<ODataPathKind, IPathItemHandler> _handlers = new Dictionary<ODataPathKind, IPathItemHandler>
|
||||
private readonly IDictionary<ODataPathKind, IPathItemHandler> _handlers = new Dictionary<ODataPathKind, IPathItemHandler>
|
||||
{
|
||||
// EntitySet
|
||||
{ ODataPathKind.EntitySet, new EntitySetPathItemHandler() },
|
||||
|
|
Loading…
Reference in a new issue