Skip to content

Commit

Permalink
feat(cli): send up example response status code (#5774)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Jan 29, 2025
1 parent dae6c0b commit 53ed96d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
- changelogEntry:
- summary: |
Fixed OpenAPI importer to properly handle response status codes in documentation by propagating
the status code from the OpenAPI spec through the IR and FDR layers.
type: fix
irVersion: 55
version: 0.51.8

- changelogEntry:
- summary: |
Added better error messages when markdown files reference non-existent MDX files, showing the relative path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,9 @@ function convertHttpEndpointExample({
responseStatusCode: Ir.http.ExampleResponse._visit(example.response, {
ok: (ok) =>
ok._visit({
body: (body) => (body != null ? 200 : 204),
stream: (stream) => (stream.length > 0 ? 200 : 204),
sse: (stream) => (stream.length > 0 ? 200 : 204),
body: (body) => ((irEndpoint.response?.statusCode ?? body != null) ? 200 : 204),
stream: (stream) => ((irEndpoint.response?.statusCode ?? stream.length > 0) ? 200 : 204),
sse: (stream) => ((irEndpoint.response?.statusCode ?? stream.length > 0) ? 200 : 204),
_other: () => {
throw new Error("Unknown ExampleResponseBody: " + ok.type);
}
Expand Down

0 comments on commit 53ed96d

Please sign in to comment.