You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[UnboundOperation]
public Category GetFirstCategory(string code)
{
var claimsPrincipal = ClaimsPrincipal.Current;
Console.WriteLine($"ClaimsPrincipal Logged In: {claimsPrincipal.Identity.IsAuthenticated}");
return DbContext.Categories.FirstOrDefault();
}
open swagger throw error
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidCastException: Unable to cast object of type 'Microsoft.OData.Edm.EdmPrimitiveTypeReference' to type 'Microsoft.OData.Edm.IEdmStringTypeReference'.
at Microsoft.OpenApi.OData.Generator.OpenApiEdmTypeSchemaGenerator.CreateSchema(ODataContext context, IEdmPrimitiveTypeReference primitiveType)
at Microsoft.OpenApi.OData.Generator.OpenApiEdmTypeSchemaGenerator.CreateEdmTypeSchema(ODataContext context, IEdmTypeReference edmTypeReference)
at Microsoft.OpenApi.OData.Generator.OpenApiParameterGenerator.CreateParameters(ODataContext context, IEdmFunction function, IDictionary`2 parameterNameMapping)
at Microsoft.OpenApi.OData.Generator.OpenApiParameterGenerator.CreateParameters(ODataContext context, IEdmFunctionImport functionImport)
at Microsoft.OpenApi.OData.Operation.EdmFunctionImportOperationHandler.SetParameters(OpenApiOperation operation)
at Microsoft.OpenApi.OData.Operation.OperationHandler.CreateOperation(ODataContext context, ODataPath path)
at Microsoft.OpenApi.OData.PathItem.PathItemHandler.AddOperation(OpenApiPathItem item, OperationType operationType)
at Microsoft.OpenApi.OData.PathItem.OperationImportPathItemHandler.SetOperations(OpenApiPathItem item)
at Microsoft.OpenApi.OData.PathItem.PathItemHandler.CreatePathItem(ODataContext context, ODataPath path)
at Microsoft.OpenApi.OData.Generator.OpenApiPathItemGenerator.CreatePathItems(ODataContext context)
at Microsoft.OpenApi.OData.Generator.OpenApiPathsGenerator.CreatePaths(ODataContext context)
at Microsoft.OpenApi.OData.Generator.OpenApiDocumentGenerator.CreateDocument(ODataContext context)
at Microsoft.OpenApi.OData.EdmModelOpenApiExtensions.ConvertToOpenApi(IEdmModel model, OpenApiConvertSettings settings)
at Microsoft.Restier.AspNetCore.Swagger.RestierSwaggerProvider.GetSwagger(String documentName, String host, String basePath) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore.Swagger\RestierSwaggerProvider.cs:line 73
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.Restier.AspNetCore.Middleware.RestierClaimsPrincipalMiddleware.InvokeAsync(HttpContext httpContext, IHttpContextAccessor contextAccessor) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore\Middleware\RestierClaimsPrincipalMiddleware.cs:line 51
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.Restier.AspNetCore.Middleware.ODataBatchHttpContextFixerMiddleware.InvokeAsync(HttpContext httpContext, IHttpContextAccessor contextAccessor) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore\Middleware\ODataBatchHttpContextFixerMiddleware.cs:line 49
at Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
The text was updated successfully, but these errors were encountered:
Short summary (3-5 sentences) describing the issue.
Assemblies affected
V1.1.1
Reproduce steps
Clone project Modify Microsoft.Restier.Samples.Northwind.AspNetCore GetFirstCategory add (string code)
open swagger throw error
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidCastException: Unable to cast object of type 'Microsoft.OData.Edm.EdmPrimitiveTypeReference' to type 'Microsoft.OData.Edm.IEdmStringTypeReference'.
at Microsoft.OpenApi.OData.Generator.OpenApiEdmTypeSchemaGenerator.CreateSchema(ODataContext context, IEdmPrimitiveTypeReference primitiveType)
at Microsoft.OpenApi.OData.Generator.OpenApiEdmTypeSchemaGenerator.CreateEdmTypeSchema(ODataContext context, IEdmTypeReference edmTypeReference)
at Microsoft.OpenApi.OData.Generator.OpenApiParameterGenerator.CreateParameters(ODataContext context, IEdmFunction function, IDictionary`2 parameterNameMapping)
at Microsoft.OpenApi.OData.Generator.OpenApiParameterGenerator.CreateParameters(ODataContext context, IEdmFunctionImport functionImport)
at Microsoft.OpenApi.OData.Operation.EdmFunctionImportOperationHandler.SetParameters(OpenApiOperation operation)
at Microsoft.OpenApi.OData.Operation.OperationHandler.CreateOperation(ODataContext context, ODataPath path)
at Microsoft.OpenApi.OData.PathItem.PathItemHandler.AddOperation(OpenApiPathItem item, OperationType operationType)
at Microsoft.OpenApi.OData.PathItem.OperationImportPathItemHandler.SetOperations(OpenApiPathItem item)
at Microsoft.OpenApi.OData.PathItem.PathItemHandler.CreatePathItem(ODataContext context, ODataPath path)
at Microsoft.OpenApi.OData.Generator.OpenApiPathItemGenerator.CreatePathItems(ODataContext context)
at Microsoft.OpenApi.OData.Generator.OpenApiPathsGenerator.CreatePaths(ODataContext context)
at Microsoft.OpenApi.OData.Generator.OpenApiDocumentGenerator.CreateDocument(ODataContext context)
at Microsoft.OpenApi.OData.EdmModelOpenApiExtensions.ConvertToOpenApi(IEdmModel model, OpenApiConvertSettings settings)
at Microsoft.Restier.AspNetCore.Swagger.RestierSwaggerProvider.GetSwagger(String documentName, String host, String basePath) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore.Swagger\RestierSwaggerProvider.cs:line 73
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.Restier.AspNetCore.Middleware.RestierClaimsPrincipalMiddleware.InvokeAsync(HttpContext httpContext, IHttpContextAccessor contextAccessor) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore\Middleware\RestierClaimsPrincipalMiddleware.cs:line 51
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.Restier.AspNetCore.Middleware.ODataBatchHttpContextFixerMiddleware.InvokeAsync(HttpContext httpContext, IHttpContextAccessor contextAccessor) in D:\github\dotnet_start\RESTier\src\Microsoft.Restier.AspNetCore\Middleware\ODataBatchHttpContextFixerMiddleware.cs:line 49
at Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
The text was updated successfully, but these errors were encountered: