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
I have written unit tests to check if the Open API document is getting generated successfully or not. The method is as below:
async Task CoreAsync()
{
var helper = new DocumentHelper(new RouteConstraintFilter(), new OpenApiSchemaAcceptor());
var document = new Document(helper);
return await document.InitialiseDocument()
.AddMetadata(oaiInfo)
.AddNamingStrategy(new CamelCaseNamingStrategy())
.Build(assembly)
.RenderAsync(OpenApiSpecVersion.OpenApi3_0, OpenApiFormat.Json);
}
where assembly= Assembly.GetExecutingAssembly()
and oaiInfo is a custom OpenApiInfo() object.
This method always fails while trying to Build(assembly) giving the Object reference not set to an instance exception.
Has anyone encountered this issue before? Please also not that I am able to generate on the fly Swagger Json. It's only that the Build method fails.
The text was updated successfully, but these errors were encountered:
SapnaSoni123
changed the title
Build method in the CLI gives Object Reference exception when called with Assembly.GetExecutingAssembly()
Build method gives Object Reference exception when called with Assembly.GetExecutingAssembly()
Jan 6, 2022
@SapnaSoni123 Thanks for the issue! It's a known issue the CLI project. But it's de-priotised over other issues. Let's keep this issue open for further discussion.
Hi,
I have written unit tests to check if the Open API document is getting generated successfully or not. The method is as below:
async Task CoreAsync()
{
var helper = new DocumentHelper(new RouteConstraintFilter(), new OpenApiSchemaAcceptor());
var document = new Document(helper);
return await document.InitialiseDocument()
.AddMetadata(oaiInfo)
.AddNamingStrategy(new CamelCaseNamingStrategy())
.Build(assembly)
.RenderAsync(OpenApiSpecVersion.OpenApi3_0, OpenApiFormat.Json);
}
where assembly= Assembly.GetExecutingAssembly()
and oaiInfo is a custom OpenApiInfo() object.
This method always fails while trying to Build(assembly) giving the Object reference not set to an instance exception.
Has anyone encountered this issue before? Please also not that I am able to generate on the fly Swagger Json. It's only that the Build method fails.
The text was updated successfully, but these errors were encountered: