-
Notifications
You must be signed in to change notification settings - Fork 10.3k
OpenAPI Throws System.ArgumentNullException
Inside Docker
#56309
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
Comments
@evanlihou Thanks for reporting this issue! This is an interesting bug. The stack trace that you've identified (and that I was able to see using your repro) is coming from the prototype implementation of the JsonSchemaExporter APIs that we used in initial iterations of our implementation and appears to be unique to enumerable types. I was not able to reproduce this with plain old In recent versions of the build (9.0.0-preview.6.24324.2 and above), I'm not able to repro the same issue so I assume that this was a transient bug with the prototype that was resolved in the final implementation. Can you verify that using a newer version of the package from the nightly feed resolves the issue for you as well? |
I just pulled the latest nightly container image and it's still running 9.0.0-preview.6.24321.8 (which the error is still occurring on). I'll give it another day or two for the build you mentioned to get incorporated, then try a rebuild |
Still able to repro inside of Docker with the following runtime after clearing out old images and re-pulling. If there's anything else I can do to help either make this issue more reproducible or to prove it's a non-issue, I'm happy to!
|
@evanlihou Thanks for giving this another try! I realize I should've been clearer with my instructions. The build I was referring to earlier was the build of the Can you try out the changes in this branch to make sure we're on the same page? The Here's the output I see from that: http://127.0.0.1:8080/openapi/v1.json/ 20240703074318
// http://127.0.0.1:8080/openapi/v1.json
{
"openapi": "3.0.1",
"info": {
"title": "Net9OpenApiBugTest | v1",
"version": "1.0.0"
},
"paths": {
"/weatherforecast": {
"get": {
"tags": [
"Net9OpenApiBugTest"
],
"operationId": "GetWeatherForecast",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"required": [
"date",
"temperatureC",
"summary"
],
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"temperatureC": {
"type": "integer",
"format": "int32"
},
"summary": {
"type": "string",
"nullable": true
},
"temperatureF": {
"type": "integer",
"format": "int32"
}
}
}
}
}
}
}
}
}
}
},
"components": {
},
"tags": [
{
"name": "Net9OpenApiBugTest"
}
]
} |
Hi @evanlihou. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Thank you for putting together that fork. I just pulled it down and yep everything seems to be working well now, so I'll close out this issue and wait for those changes to make their way to the standard Nuget feed. Have a good holiday if you're celebrating! |
Is there an existing issue for this?
Describe the bug
When spinning up a new Web project, then building and running in Docker, an error is thrown when attempting to go to the OpenAPI endpoint. This bug does not occur when running locally outside of a container.
Expected Behavior
The OpenAPI document is returned, like it is when running locally in Debug/Run mode.
Steps To Reproduce
https://github.com/evanlihou/Net9OpenApiBugTest
Exceptions (if any)
.NET Version
9.0.0-preview.6.24307.2
Anything else?
Using latest stable version of JetBrains Rider on macOS
Using nightly
9.0-preview
Docker images as basedotnet --info
inside of containerThe text was updated successfully, but these errors were encountered: