-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): plumb relevant request/response descriptions to FDR (#4828)
* plumb relevant request responses * add tests and changelogs * update tests
- Loading branch information
1 parent
5c3ab1a
commit 8b1f8a1
Showing
71 changed files
with
9,633 additions
and
103 deletions.
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
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
98 changes: 98 additions & 0 deletions
98
...r-to-fern-tests/src/__test__/__snapshots__/openapi-docs/request-response-description.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,98 @@ | ||
{ | ||
"absoluteFilePath": "/DUMMY_PATH", | ||
"importedDefinitions": {}, | ||
"namedDefinitionFiles": { | ||
"__package__.yml": { | ||
"absoluteFilepath": "/DUMMY_PATH", | ||
"contents": { | ||
"service": { | ||
"auth": false, | ||
"base-path": "", | ||
"endpoints": { | ||
"getExample": { | ||
"auth": false, | ||
"display-name": "Get Example", | ||
"docs": undefined, | ||
"examples": [ | ||
{ | ||
"response": { | ||
"body": { | ||
"id": 1, | ||
"name": "name", | ||
}, | ||
}, | ||
}, | ||
], | ||
"method": "GET", | ||
"pagination": undefined, | ||
"path": "/example", | ||
"response": { | ||
"docs": "Successful response", | ||
"type": "Schema1", | ||
}, | ||
}, | ||
}, | ||
"source": { | ||
"openapi": "../openapi.yml", | ||
}, | ||
}, | ||
"types": { | ||
"Schema1": { | ||
"docs": "Schema 1 description", | ||
"properties": { | ||
"id": "optional<integer>", | ||
"name": "optional<string>", | ||
}, | ||
"source": { | ||
"openapi": "../openapi.yml", | ||
}, | ||
}, | ||
}, | ||
}, | ||
"rawContents": "service: | ||
auth: false | ||
base-path: '' | ||
endpoints: | ||
getExample: | ||
path: /example | ||
method: GET | ||
auth: false | ||
display-name: Get Example | ||
response: | ||
docs: Successful response | ||
type: Schema1 | ||
examples: | ||
- response: | ||
body: | ||
id: 1 | ||
name: name | ||
source: | ||
openapi: ../openapi.yml | ||
types: | ||
Schema1: | ||
docs: Schema 1 description | ||
properties: | ||
id: optional<integer> | ||
name: optional<string> | ||
source: | ||
openapi: ../openapi.yml | ||
", | ||
}, | ||
}, | ||
"packageMarkers": {}, | ||
"rootApiFile": { | ||
"contents": { | ||
"display-name": "Sample API", | ||
"error-discrimination": { | ||
"strategy": "status-code", | ||
}, | ||
"name": "api", | ||
}, | ||
"defaultUrl": undefined, | ||
"rawContents": "name: api | ||
error-discrimination: | ||
strategy: status-code | ||
display-name: Sample API | ||
", | ||
}, | ||
} |
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
141 changes: 141 additions & 0 deletions
141
...-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/request-response-description.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,141 @@ | ||
{ | ||
"title": "Sample API", | ||
"servers": [], | ||
"tags": { | ||
"tagsById": {} | ||
}, | ||
"hasEndpointsMarkedInternal": false, | ||
"endpoints": [ | ||
{ | ||
"summary": "Get Example", | ||
"audiences": [], | ||
"tags": [], | ||
"pathParameters": [], | ||
"queryParameters": [], | ||
"headers": [], | ||
"generatedRequestName": "GetExampleRequest", | ||
"response": { | ||
"description": "Successful response", | ||
"schema": { | ||
"generatedName": "GetExampleResponse", | ||
"schema": "Schema1", | ||
"groupName": [], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "reference" | ||
}, | ||
"fullExamples": [], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "json" | ||
}, | ||
"errors": {}, | ||
"server": [], | ||
"authed": false, | ||
"method": "GET", | ||
"path": "/example", | ||
"examples": [ | ||
{ | ||
"pathParameters": [], | ||
"queryParameters": [], | ||
"headers": [], | ||
"response": { | ||
"properties": { | ||
"id": { | ||
"value": { | ||
"value": 1, | ||
"type": "int" | ||
}, | ||
"type": "primitive" | ||
}, | ||
"name": { | ||
"value": { | ||
"value": "name", | ||
"type": "string" | ||
}, | ||
"type": "primitive" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"codeSamples": [], | ||
"type": "full" | ||
} | ||
], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
} | ||
} | ||
], | ||
"webhooks": [], | ||
"channel": [], | ||
"groupedSchemas": { | ||
"rootSchemas": { | ||
"Schema1": { | ||
"allOf": [], | ||
"properties": [ | ||
{ | ||
"conflict": {}, | ||
"generatedName": "schema1Id", | ||
"key": "id", | ||
"schema": { | ||
"generatedName": "schema1Id", | ||
"value": { | ||
"schema": { | ||
"type": "int" | ||
}, | ||
"generatedName": "Schema1Id", | ||
"groupName": [], | ||
"type": "primitive" | ||
}, | ||
"groupName": [], | ||
"type": "optional" | ||
}, | ||
"audiences": [] | ||
}, | ||
{ | ||
"conflict": {}, | ||
"generatedName": "schema1Name", | ||
"key": "name", | ||
"schema": { | ||
"generatedName": "schema1Name", | ||
"value": { | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"generatedName": "Schema1Name", | ||
"groupName": [], | ||
"type": "primitive" | ||
}, | ||
"groupName": [], | ||
"type": "optional" | ||
}, | ||
"audiences": [] | ||
} | ||
], | ||
"allOfPropertyConflicts": [], | ||
"description": "Schema 1 description", | ||
"generatedName": "Schema1", | ||
"groupName": [], | ||
"additionalProperties": false, | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"namespacedSchemas": {} | ||
}, | ||
"variables": {}, | ||
"nonRequestReferencedSchemas": {}, | ||
"securitySchemes": {}, | ||
"globalHeaders": [], | ||
"idempotencyHeaders": [], | ||
"groups": {} | ||
} |
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
Oops, something went wrong.