-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): conjure importer handles parsing query params on file upload (
#5157) * Update `ConjureImporter` and implement debug tests. * fix * Minor fixes & changelog entry * chore: update changelog --------- Co-authored-by: Eden <[email protected]> Co-authored-by: fern-bot <[email protected]>
- Loading branch information
1 parent
a6b7511
commit 48e2b03
Showing
9 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## 0.45.0-rc39 | ||
**`(fix):`** The OpenAPI importer now supports correlating request and response examples by name. When an example name is shared | ||
between a request body and response, they will be paired together in the generated Fern definition. | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## 0.45.0-rc40 | ||
**`(fix):`** Fixed bug in the Conjure importer where query parameters were overwritten during endpoint parameter parsing. | ||
|
||
|
81 changes: 81 additions & 0 deletions
81
packages/cli/api-importers/conjure/conjure-to-fern-tests/__test__/__snapshots__/debug.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"absoluteFilePath": "/DUMMY_PATH", | ||
"rootApiFile": { | ||
"contents": { | ||
"name": "api", | ||
"error-discrimination": { | ||
"strategy": "status-code" | ||
} | ||
}, | ||
"rawContents": "name: api\nerror-discrimination:\n strategy: status-code\n" | ||
}, | ||
"namedDefinitionFiles": { | ||
"Debug/__package__.yml": { | ||
"absoluteFilepath": "/DUMMY_PATH", | ||
"rawContents": "service:\n auth: false\n base-path: /debug\n endpoints:\n debugEndpointAlpha:\n auth: true\n path: /debug-endpoint-alpha\n method: GET\n response: string\n docs: Test endpoint alpha.\n request:\n body: string\n debugEndpointBeta:\n auth: true\n path: /debug-endpoint-beta/{param1}\n method: GET\n response: string\n docs: Test endpoint beta.\n path-parameters:\n param1:\n type: string\n request:\n query-parameters:\n param2: string\n name: debugEndpointBetaRequest\n debugEndpointGamma:\n auth: true\n path: /debug-endpoint-beta/{param1}/test\n method: POST\n response: string\n docs: Test endpoint gamma.\n path-parameters:\n param1:\n type: string\n request:\n query-parameters:\n param2: string\n param3: string\n body: bytes\n name: debugEndpointGammaRequest\n", | ||
"contents": { | ||
"service": { | ||
"auth": false, | ||
"base-path": "/debug", | ||
"endpoints": { | ||
"debugEndpointAlpha": { | ||
"auth": true, | ||
"path": "/debug-endpoint-alpha", | ||
"method": "GET", | ||
"response": "string", | ||
"docs": "Test endpoint alpha.", | ||
"request": { | ||
"body": "string" | ||
} | ||
}, | ||
"debugEndpointBeta": { | ||
"auth": true, | ||
"path": "/debug-endpoint-beta/{param1}", | ||
"method": "GET", | ||
"response": "string", | ||
"docs": "Test endpoint beta.", | ||
"path-parameters": { | ||
"param1": { | ||
"type": "string" | ||
} | ||
}, | ||
"request": { | ||
"query-parameters": { | ||
"param2": "string" | ||
}, | ||
"name": "debugEndpointBetaRequest" | ||
} | ||
}, | ||
"debugEndpointGamma": { | ||
"auth": true, | ||
"path": "/debug-endpoint-beta/{param1}/test", | ||
"method": "POST", | ||
"response": "string", | ||
"docs": "Test endpoint gamma.", | ||
"path-parameters": { | ||
"param1": { | ||
"type": "string" | ||
} | ||
}, | ||
"request": { | ||
"query-parameters": { | ||
"param2": "string", | ||
"param3": "string" | ||
}, | ||
"body": "bytes", | ||
"name": "debugEndpointGammaRequest" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"__package__.yml": { | ||
"absoluteFilepath": "/DUMMY_PATH", | ||
"rawContents": "{}\n", | ||
"contents": {} | ||
} | ||
}, | ||
"packageMarkers": {}, | ||
"importedDefinitions": {} | ||
} |
This file contains 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
47 changes: 47 additions & 0 deletions
47
...cli/api-importers/conjure/conjure-to-fern-tests/__test__/fixtures/debug/conjure/debug.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
types: | ||
definitions: | ||
default-package: com.birch.debug.service | ||
|
||
services: | ||
DebugService: | ||
name: Generic debug service | ||
package: com.birch.debug.service | ||
base-path: /debug | ||
endpoints: | ||
|
||
debugEndpointAlpha: | ||
docs: Test endpoint alpha. | ||
http: GET /debug-endpoint-alpha | ||
auth: header | ||
args: | ||
param1: string | ||
param2: string | ||
returns: string | ||
|
||
debugEndpointBeta: | ||
docs: Test endpoint beta. | ||
http: GET /debug-endpoint-beta/{param1} | ||
args: | ||
param1: | ||
type: string | ||
param-type: path | ||
param2: | ||
type: string | ||
param-type: query | ||
returns: string | ||
|
||
debugEndpointGamma: | ||
docs: Test endpoint gamma. | ||
http: POST /debug-endpoint-beta/{param1}/test | ||
args: | ||
param1: | ||
type: string | ||
param-type: path | ||
param2: | ||
type: string | ||
param-type: query | ||
param3: | ||
type: string | ||
param-type: query | ||
body: binary | ||
returns: string |
4 changes: 4 additions & 0 deletions
4
...api-importers/conjure/conjure-to-fern-tests/__test__/fixtures/debug/fern/fern.config.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"organization": "fern", | ||
"version": "*" | ||
} |
11 changes: 11 additions & 0 deletions
11
...i/api-importers/conjure/conjure-to-fern-tests/__test__/fixtures/debug/fern/generators.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
api: | ||
specs: | ||
conjure: ../conjure | ||
groups: | ||
local: | ||
generators: | ||
- name: fernapi/fern-typescript-node-sdk | ||
version: 0.39.3 | ||
output: | ||
location: local-file-system | ||
path: ../sdks/typescript |
This file contains 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
This file contains 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