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

Servers not emitted in OpenAPI document #56188

Open
1 task done
martincostello opened this issue Jun 11, 2024 · 0 comments · May be fixed by #56470
Open
1 task done

Servers not emitted in OpenAPI document #56188

martincostello opened this issue Jun 11, 2024 · 0 comments · May be fixed by #56470

Comments

@martincostello
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I ran the spectral CLI against the OpenAPI schema generated for an app of mine using .NET 9 preview.4, and there was a single warning against it:

oas3-api-servers
OpenAPI "servers" must be present and non-empty array.

I see in #54598 that servers is mentioned, but I can't find anything explicit to track adding it in another issue or in any of the checkboxes in that issue.

servers: Derived from the host info registered in the IServer implementation.

It also isn't currently assigned in the code:

var document = new OpenApiDocument
{
Info = GetOpenApiInfo(),
Paths = await GetOpenApiPathsAsync(capturedTags, cancellationToken),
Tags = [.. capturedTags]
};

Expected Behavior

The servers property is present in the emitted OpenAPI schema document.

Steps To Reproduce

Generate an OpenAPI document for a Minimal API using the new OpenAPI NuGet package.

Exceptions (if any)

None.

.NET Version

9.0.100-preview.4.24267.66

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants