Treat connection upgrade (HTTP 101) as normal success.#1320
Open
Treat connection upgrade (HTTP 101) as normal success.#1320
Conversation
This fixes a bug wherein client code would be generated for a 2XX-range response on WebSocket endpoints, which in turn would unnecessarily trip an `assert!(response_types.len() <= 1)` in `extract_responses` when explicit status codes are provided in the OpenAPI document. (This also fixes a bug in such a scenario wherein *all* responses, including HTTP errors, would be set to Upgrade type) (As in dropshot#1548)
4 tasks
ahl
requested changes
Feb 27, 2026
Comment on lines
+476
to
+481
| // TODO: remove when no longer supporting older dropshot | ||
| // w/o explicit response codes for WebSocket endpoints: | ||
| || (dropshot_websocket && status_code == OperationResponseStatus::Default) | ||
| { | ||
| // TODO (as above) | ||
| status_code = OperationResponseStatus::Code(101); |
Collaborator
There was a problem hiding this comment.
let's delete this now; I don't think we need to support the erroneous format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug wherein client code would be generated for a 2XX-range response on WebSocket endpoints, which in turn would unnecessarily trip an
assert!(response_types.len() <= 1)inextract_responseswhen explicit status codes are provided in the OpenAPI document (oxidecomputer/dropshot#1554). This also fixes a bug in such a scenario wherein all modeled response codes, including HTTP errors, would be set toOperationResponseKind::Upgrade.Prior to this change, progenitor (incorrectly) outputs:
With this change alone, progenitor instead outputs:
With this change plus the explicitly-modeled error codes ( oxidecomputer/dropshot#1554 ), progenitor outputs:
And in turn, the CLI, which previously would only close with
Connection lost.on errors prior to the server's accepting the protocol change, with this version of progenitor would now instead output, for example: