Skip to content

Commit

Permalink
fix(cli): openapi parser plumbs through custom content type (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Sep 26, 2024
1 parent 1a1754c commit e1e2ab6
Show file tree
Hide file tree
Showing 84 changed files with 2,067 additions and 713 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: |
The OpenAPI parser now respects the content type in your OpenAPI spec, instead of always sending
`application/json`. With this upgrade, your SDKs will also start to send the correct content type.
type: fix
irVersion: 53
version: 0.43.4

- changelogEntry:
- summary: |
The CLI now passes in the API definition ID once again, this is necessary so that generated snippet templates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,4 +872,4 @@ exports[`dependencies > correctly incorporates dependencies 1`] = `
}"
`;

exports[`dependencies > file dependencies 1`] = `3086374`;
exports[`dependencies > file dependencies 1`] = `3086444`;
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ service:
display-name: Create a booking
request:
body: trainsRoot.Booking
content-type: application/json
response:
docs: Booking successful
type: CreateBookingResponse
Expand Down Expand Up @@ -1061,6 +1062,7 @@ service:
display-name: Pay for a Booking
request:
body: trainsRoot.BookingPayment
content-type: application/json
response:
docs: Payment successful
type: CreateBookingPaymentResponse
Expand Down Expand Up @@ -1867,6 +1869,7 @@ service:
audiences:
- public
availability: pre-release
content-type: application/json
response:
docs: OK
type: list<string>
Expand Down Expand Up @@ -2150,6 +2153,7 @@ service:
return_prompt:
type: optional<boolean>
docs: Whether to return the prompt in the response.
content-type: application/json
response:
docs: OK
type: list<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ service:
audiences:
- public
availability: pre-release
content-type: application/json
response:
docs: OK
type: list<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ service:
return_prompt:
type: optional<boolean>
docs: Whether to return the prompt in the response.
content-type: application/json
response:
docs: OK
type: list<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ service:
display-name: Create a booking
request:
body: trainsRoot.Booking
content-type: application/json
response:
docs: Booking successful
type: CreateBookingResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ service:
display-name: Pay for a Booking
request:
body: trainsRoot.BookingPayment
content-type: application/json
response:
docs: Payment successful
type: CreateBookingPaymentResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3654,7 +3654,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down Expand Up @@ -4762,7 +4762,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down Expand Up @@ -5258,7 +5258,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down Expand Up @@ -11975,7 +11975,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down Expand Up @@ -16556,7 +16556,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@
}
},
"extends": [],
"contentType": null,
"contentType": "application/json",
"properties": [
{
"name": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ exports[`open api parser > ada > docs 1`] = `
},
"request": {
"body": "root.EndUserRequest",
"content-type": "application/json",
},
"response": {
"docs": "OK",
Expand Down Expand Up @@ -552,6 +553,7 @@ exports[`open api parser > ada > simple 1`] = `
},
"request": {
"body": "root.EndUserRequest",
"content-type": "application/json",
},
"response": {
"docs": "OK",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`anyOf > anyOf > docs 1`] = `
},
},
},
"content-type": "application/json",
"headers": undefined,
"name": "Request",
"query-parameters": undefined,
Expand Down Expand Up @@ -109,6 +110,7 @@ exports[`anyOf > anyOf > simple 1`] = `
},
},
},
"content-type": "application/json",
"headers": undefined,
"name": "Request",
"query-parameters": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ The authenticated user must have the \`account.allows.manageJointOwners\` permis
],
"properties": {},
},
"content-type": "application/json",
"headers": undefined,
"name": "NewJointOwnerInvitation",
"query-parameters": undefined,
Expand Down Expand Up @@ -1001,6 +1002,7 @@ The user must have the \`allows.manageOverdraftAccounts\` permission on the acco
],
"properties": {},
},
"content-type": "application/json",
"headers": undefined,
"name": "OverdraftProtectionPatch",
"query-parameters": undefined,
Expand Down Expand Up @@ -1338,6 +1340,7 @@ Note: This operation requires an identity challenge if the financial institution
},
},
},
"content-type": "application/json",
"headers": {
"Challenge": {
"docs": "This operation may require a completed challenge. If the first attempt calling this operation fails with a 401 \`challengeRequired\` error, the client should complete the challenge flow as described in the Challenges API, then retry the operation with this \`Challenge\` request header using the \`challengeToken\` returned at the end of that flow. If this is passed but the value is invalid, the operation fails with a 401 status code and the \`invalidChallengeHeader\` problem type.",
Expand Down Expand Up @@ -1650,6 +1653,7 @@ Note: This operation requires an identity challenge if the financial institution
},
},
},
"content-type": "application/merge-patch+json",
"headers": {
"Challenge": {
"docs": "This operation may require a completed challenge. If the first attempt calling this operation fails with a 401 \`challengeRequired\` error, the client should complete the challenge flow as described in the Challenges API, then retry the operation with this \`Challenge\` request header using the \`challengeToken\` returned at the end of that flow. If this is passed but the value is invalid, the operation fails with a 401 status code and the \`invalidChallengeHeader\` problem type.",
Expand Down Expand Up @@ -6915,6 +6919,7 @@ The authenticated user must have the \`account.allows.manageJointOwners\` permis
],
"properties": {},
},
"content-type": "application/json",
"headers": undefined,
"name": "NewJointOwnerInvitation",
"query-parameters": undefined,
Expand Down Expand Up @@ -7093,6 +7098,7 @@ The user must have the \`allows.manageOverdraftAccounts\` permission on the acco
],
"properties": {},
},
"content-type": "application/json",
"headers": undefined,
"name": "OverdraftProtectionPatch",
"query-parameters": undefined,
Expand Down Expand Up @@ -7430,6 +7436,7 @@ Note: This operation requires an identity challenge if the financial institution
},
},
},
"content-type": "application/json",
"headers": {
"Challenge": {
"docs": "This operation may require a completed challenge. If the first attempt calling this operation fails with a 401 \`challengeRequired\` error, the client should complete the challenge flow as described in the Challenges API, then retry the operation with this \`Challenge\` request header using the \`challengeToken\` returned at the end of that flow. If this is passed but the value is invalid, the operation fails with a 401 status code and the \`invalidChallengeHeader\` problem type.",
Expand Down Expand Up @@ -7742,6 +7749,7 @@ Note: This operation requires an identity challenge if the financial institution
},
},
},
"content-type": "application/merge-patch+json",
"headers": {
"Challenge": {
"docs": "This operation may require a completed challenge. If the first attempt calling this operation fails with a 401 \`challengeRequired\` error, the client should complete the challenge flow as described in the Challenges API, then retry the operation with this \`Challenge\` request header using the \`challengeToken\` returned at the end of that flow. If this is passed but the value is invalid, the operation fails with a 401 status code and the \`invalidChallengeHeader\` problem type.",
Expand Down
Loading

0 comments on commit e1e2ab6

Please sign in to comment.