Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSwag UI Loader keeps spinning #4872

Open
mmaderic opened this issue Apr 28, 2024 · 0 comments
Open

NSwag UI Loader keeps spinning #4872

mmaderic opened this issue Apr 28, 2024 · 0 comments

Comments

@mmaderic
Copy link

I have applied a custom IOperationProcessor globally to all endpoints:

public class DocumentationProcessor : IOperationProcessor
{
    public bool Process(OperationProcessorContext context)
    {
        context.OperationDescription.Operation.Parameters.Add(
            new OpenApiParameter
            {
                Name = Constants.Header.TenantId,
                Kind = OpenApiParameterKind.Header,
                Type = NJsonSchema.JsonObjectType.String,
                IsRequired = true,
                Description = "Organization identifier"
            });

        return true;
    }
}

This shows the header field, but if the value is not provided, the UI throws an error in the console without stopping the spinner, which keeps on spinning, without showing any error message in the UI.

swagger-ui-bundle.js:2  Error: Required parameter x-my-header is not provided
    at swagger-ui-bundle.js:2:1019594
    at Array.forEach (<anonymous>)
    at Object.execute_buildRequest [as buildRequest] (swagger-ui-bundle.js:2:1019082)
    at swagger-ui-bundle.js:2:738691
    at swagger-ui-bundle.js:2:597099
    at swagger-ui-bundle.js:2:592921
    at swagger-ui-bundle.js:2:743368
    at Object.newAction (swagger-ui-bundle.js:2:606084)
    at Object.executeRequest (swagger-ui-bundle.js:2:610357)
    at swagger-ui-bundle.js:2:739687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant