Skip to content

fix: add support for response header rendering for status code 204 #1965

New issue

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

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

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abhishekmsingh
Copy link

While having a spec like

"responses": {
                    "204": {
                        "description": "Success",
                        "headers": {
                            "X-Auth-Token": {
                                "description": "header containing the auth token",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }

we don't get the responseheader hook in the generated clientservice since it is filtered out. Whereas according to HTTP spec(https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.5-1) and MDN docs(https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses) 204 can include headers

@abhishekmsingh
Copy link
Author

@ferdikoomen review?

@abhishekmsingh abhishekmsingh marked this pull request as draft January 3, 2024 20:05
@abhishekmsingh abhishekmsingh changed the title add support for response header rendering for status code 204 fix: add support for response header rendering for status code 204 Jan 3, 2024
@mrlubos
Copy link
Collaborator

mrlubos commented Jan 28, 2024

Hey @abhiandthetruth, please check out our fork, that might have what you're looking for

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants