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
Running the command to generate the C# client code from the open-API v3 json file from the official PagerDuty url results in an unhandled exception by the nswag command and thus doesn't get to generate any code.
NSwag should be able to generate most of the code and skip through the schema validation errors whenever possible, but at the moment the error results in no code at all in the output.
For example, the openapi-generator tool is able to generate the code for this case:
Even if the generated code has some errors, we can manually fix those latter after the tool generates the base for it, the tool should be able to generate 99% of the code.
Running the command to generate the C# client code from the open-API v3 json file from the official PagerDuty url results in an unhandled exception by the
nswag
command and thus doesn't get to generate any code.Error:
System.InvalidOperationException: Could not resolve the path '#/components/responses/OrchestrationPathServiceActiveResponse/content/application~1json/schema'.
at NJsonSchema.JsonReferenceResolver.ResolveDocumentReference(Object rootObject, String jsonPath, Type targetType, IContractResolver contractResolver)
at NJsonSchema.JsonReferenceResolver.ResolveReferenceAsync(Object rootObject, String jsonPath, Type targetType, IContractResolver contractResolver, Boolean append, CancellationToken cancellationToken)
at NJsonSchema.JsonReferenceResolver.ResolveReferenceAsync(Object rootObject, String jsonPath, Type targetType, IContractResolver contractResolver, CancellationToken cancellationToken)
at NJsonSchema.JsonSchemaReferenceUtilities.JsonReferenceUpdater.VisitJsonReferenceAsync(IJsonReference reference, String path, String typeNameHint, CancellationToken cancellationToken)
at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, String path, String typeNameHint, ISet
1 checkedObjects, Action
1 replacer, CancellationToken cancellationToken)at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.VisitAsync(Object obj, CancellationToken cancellationToken)
at NJsonSchema.JsonSchemaReferenceUtilities.JsonReferenceUpdater.VisitAsync(Object obj, CancellationToken cancellationToken)
at NJsonSchema.JsonSchemaReferenceUtilities.UpdateSchemaReferencesAsync(Object rootObject, JsonReferenceResolver referenceResolver, IContractResolver contractResolver, CancellationToken cancellationToken)
at NJsonSchema.Infrastructure.JsonSchemaSerialization.FromJsonWithLoaderAsync[T](Func
1 loader, SchemaType schemaType, String documentPath, Func
2 referenceResolverFactory, IContractResolver contractResolver, CancellationToken cancellationToken)at NSwag.OpenApiDocument.FromJsonAsync(String data, String documentPath, SchemaType expectedSchemaType, Func`2 referenceResolverFactory, CancellationToken cancellationToken) in //src/NSwag.Core/OpenApiDocument.cs:line 204
at NSwag.OpenApiDocument.FromUrlAsync(String url, CancellationToken cancellationToken) in //src/NSwag.Core/OpenApiDocument.cs:line 236
at NSwag.Commands.InputOutputCommandBase.GetInputSwaggerDocument() in //src/NSwag.Commands/Commands/InputOutputCommandBase.cs:line 47
at NSwag.Commands.CodeGeneration.OpenApiToCSharpClientCommand.RunAsync() in //src/NSwag.Commands/Commands/CodeGeneration/OpenApiToCSharpClientCommand.cs:line 281
at NSwag.Commands.CodeGeneration.OpenApiToCSharpClientCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/CodeGeneration/OpenApiToCSharpClientCommand.cs:line 270
at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.ProcessAsync(String[] args) in //src/NSwag.Commands/NSwagCommandProcessor.cs:line 65
Image screenshot:
Running windows 11, PowerShell 7.4.4,
NSwag version: 14.1.0.0
NJsonSchema version: 11.0.2.0 (Newtonsoft.Json v13.0.0.0)
The text was updated successfully, but these errors were encountered: