-
Notifications
You must be signed in to change notification settings - Fork 171
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
[Bug] Response status-code
is not reflected in generated openapi spec
#4777
Comments
@dannysheridan is there some sort of workaround for this? |
@dannysheridan, I just remembered this issue. Is there any way to resolve it? I completely understand if not; I just want to ensure I'm not overlooking anything. |
We seem to be hitting the same issue. The intermediate representation looks fine (at least with my basic understanding of it): [...]
"response": {
"status-code": 201,
"body": {
"type": "json",
"value": {
"type": "response",
"responseBodyType": {
"_type": "named",
"name": {
"originalName": "ExternalPOSSale",
[...] but the generated openapi json just says 200 instead of 201: [...]
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/externalposExternalPOSSale"
},
"examples": {
// example omitted
}
}
}
}
},
[...] |
@marcklingen no, you're not overlooking anything. This is a change that needs to be made to our OpenAPI spec converter: https://github.com/fern-api/fern/blob/main/generators/openapi/src/convertToOpenApi.ts @gustavkauman what's the use case for needing an OpenAPI spec for your team? |
@dannysheridan We have a consumer of the API that's using OpenAPI spec to generate code stubs from. I did a patch for this issue, would you be open to accepting? |
@gustavkauman up to open up a PR on the /fern-api/fern repo? Would love to show you as a contributor! |
@dannysheridan sure thing! Opened the PR #5722 |
Describe the Bug
When defining an api in fern with a custom response status code (docs), this status code is not reflected in the generated openapi spec.
Information to Reproduce
CLI Version
0.43.7
Generator Version
0.0.31
Custom Config
Any custom configuration requires to r
eproduce the bug (found in
generators.yml
).Fern Definition
The minimal fern definition required to reproduce the bug.
Actual OpenAPI
The buggy OpenAPI document that is produced:
Expected OpenAPI
The buggy OpenAPI document that is produced:
Additional Context
Repo is public:
Let me know if any additional context is helpful!
The text was updated successfully, but these errors were encountered: