add some comments for Operation generater and change Tags unit test name
This commit is contained in:
parent
a29eed1d8e
commit
71e4f379c0
|
@ -668,6 +668,12 @@ namespace Microsoft.OpenApi.OData.Generator
|
|||
return operation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a <see cref="OpenApiOperation"/> for a <see cref="IEdmOperationImport"/>.
|
||||
/// </summary>
|
||||
/// <param name="context">The OData context.</param>
|
||||
/// <param name="operationImport">The Edm operation import.</param>
|
||||
/// <returns>The created <see cref="OpenApiOperation"/>.</returns>
|
||||
public static OpenApiOperation CreateOperation(this ODataContext context,
|
||||
IEdmOperationImport operationImport)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace Microsoft.OpenApi.OData.Generator
|
|||
var entityPathItem = context.CreateEntityPathItem(entitySet);
|
||||
pathItems.Add(entityPathName, entityPathItem);
|
||||
|
||||
// bound operations to entity set or entity
|
||||
foreach (var item in context.CreateOperationPathItems(entitySet))
|
||||
{
|
||||
pathItems.Add(item.Key, item.Value);
|
||||
|
@ -63,6 +64,7 @@ namespace Microsoft.OpenApi.OData.Generator
|
|||
var singletonPathItem = context.CreateSingletonPathItem(singleton);
|
||||
pathItems.Add(singletonPathName, singletonPathItem);
|
||||
|
||||
// bound operations to singleton
|
||||
foreach (var item in context.CreateOperationPathItems(singleton))
|
||||
{
|
||||
pathItems.Add(item.Key, item.Value);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.OData.Edm;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Microsoft.OpenApi.OData.Generator.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateTagsReturnsNullForEmptyModel()
|
||||
public void CreateTagsReturnsEmptyTagsForEmptyModel()
|
||||
{
|
||||
// Arrange
|
||||
ODataContext context = new ODataContext(EdmModelHelper.EmptyModel);
|
||||
|
|
Loading…
Reference in a new issue