-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Set OpenApiServers object in document #56470
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
Conversation
ee6f2dd
to
04799a4
Compare
I've temporarily reverted In OpenAPI v3.0, when
In OpenAPI v3.1, we rely on JSON schema rules which don't enable similar validation on |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's restricting this to development mode? Is it safe to include the server address(es) in a document that users can query?
Update the PR description so the readonly issue isn't closed 😄
99c5aa0
to
4bb0021
Compare
Added an explicit check for the host environment here. This should achieve the desired goal of only settings the servers attribute for local scenarios where you might want to use something like Swagger UI or Postman to do E2E testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I didn't notice a test with multiple addresses?
Just added one. |
Is there a way to get your servers to show when the environment is Production? |
One way you can do it is using my OpenAPI extensions library, which includes a document transformer that adds the servers to the document for Production via an opt-in setting. If you don't want to use that, then you'll need to implement your own document transformer to do it. |
Closes #56188 by setting
servers
property in local development based on metadata inIServerAddressFeature
.