asyncapi / saunter

Saunter is a code-first AsyncAPI documentation generator for dotnet.
https://www.asyncapi.com/
MIT License
204 stars 57 forks source link

Saunter breaking when used with NSwag > 13.16.1 #156

Closed cvietor closed 1 year ago

cvietor commented 1 year ago

When using Saunter (0.11.0) along with a NSwag version greater than 13.16.1, document generation is broken, propably because of updates in NSwag regarding Namotion.Reflection, used by NJsonSchema. I suspect this NSwag release to be the interfering issue for saunter: https://github.com/RicoSuter/NSwag/releases/tag/v13.17.0

Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.MissingMethodException: Method not found: 'System.String Namotion.Reflection.XmlDocsExtensions.GetXmlDocsRemarks(System.Reflection.MemberInfo, Boolean)'.
         at Saunter.Generation.DocumentGenerator.GenerateOperationFromMethod(MethodInfo method, AsyncApiSchemaResolver schemaResolver, OperationType operationType, AsyncApiOptions options, JsonSchemaGenerator jsonSchemaGenerator, IServiceProvider
serviceProvider)
         at Saunter.Generation.DocumentGenerator.GenerateChannelsFromMethods(IEnumerable`1 asyncApiTypes, AsyncApiSchemaResolver schemaResolver, AsyncApiOptions options, JsonSchemaGenerator jsonSchemaGenerator, IServiceProvider serviceProvider)
         at Saunter.Generation.DocumentGenerator.GenerateChannels(TypeInfo[] asyncApiTypes, AsyncApiSchemaResolver schemaResolver, AsyncApiOptions options, JsonSchemaGenerator jsonSchemaGenerator, IServiceProvider serviceProvider)
         at Saunter.Generation.DocumentGenerator.GenerateDocument(TypeInfo[] asyncApiTypes, AsyncApiOptions options, AsyncApiDocument prototype, IServiceProvider serviceProvider)
         at Saunter.Generation.AsyncApiDocumentProvider.GetDocument(AsyncApiOptions options, AsyncApiDocument prototype)
         at Saunter.AsyncApiMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

I tested and can verify that this issue will be fixed after integrating #154

m-wild commented 1 year ago

This is live in v0.12.0