Skip to content

Commit

Permalink
feat(cli): plumb relevant request/response descriptions to FDR (#4828)
Browse files Browse the repository at this point in the history
* plumb relevant request responses

* add tests and changelogs

* update tests
  • Loading branch information
RohinBhargava authored Oct 7, 2024
1 parent 5c3ab1a commit 8b1f8a1
Show file tree
Hide file tree
Showing 71 changed files with 9,633 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function convertRequest({
// convert as application/octet-stream
if (isOctetStreamRequest(resolvedRequestBody)) {
return RequestWithExample.octetStream({
description: undefined,
description: resolvedRequestBody.description,
source
});
}
Expand Down Expand Up @@ -180,7 +180,7 @@ export function convertRequest({
isReferenceObject(multipartSchema) && context.getNumberOfOccurrencesForRef(multipartSchema) === 1
? resolvedMultipartSchema.id
: undefined,
description: undefined,
description: resolvedMultipartSchema.schema.description,
properties,
source
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23181,6 +23181,7 @@ docs: The Contracts resource lets you create, amend and, retrieve Deel contracts
},
},
"content-type": "multipart/form-data",
"docs": "This is the file you will upload in a multi-part form.",
"headers": undefined,
"name": "AddContractDocumentRequest",
"query-parameters": undefined,
Expand Down Expand Up @@ -23409,6 +23410,7 @@ docs: The Contracts resource lets you create, amend and, retrieve Deel contracts
},
},
"content-type": "multipart/form-data",
"docs": "This is the file you will upload in a multi-part form.",
"headers": undefined,
"name": "EditContractDocumentRequest",
"query-parameters": undefined,
Expand Down Expand Up @@ -24264,6 +24266,7 @@ service:
properties:
file: optional<file>
content-type: multipart/form-data
docs: This is the file you will upload in a multi-part form.
response:
docs: Successful operation.
type: root.ContractDocumentContainer
Expand Down Expand Up @@ -24302,6 +24305,7 @@ service:
properties:
file: optional<file>
content-type: multipart/form-data
docs: This is the file you will upload in a multi-part form.
response:
docs: Successful operation.
type: root.ContractDocumentContainer
Expand Down
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
",
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -6039,6 +6039,7 @@ to us as a value of the `part_size` parameter (in bytes).
},
},
"content-type": "multipart/form-data",
"docs": "Multipart upload parameters to start multipart uploading.",
"headers": undefined,
"name": "MultipartFileUploadStartRequest",
"query-parameters": undefined,
Expand Down Expand Up @@ -6472,6 +6473,7 @@ service:
signature: optional<root.SignatureType>
expire: optional<root.ExpireType>
content-type: multipart/form-data
docs: Multipart upload parameters to start multipart uploading.
response:
docs: Multipart upload started successfully.
type: MultipartFileUploadStartResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7621,6 +7621,7 @@
"headers": [],
"generatedRequestName": "AddContractDocumentRequest",
"request": {
"description": "This is the file you will upload in a multi-part form.",
"properties": [
{
"key": "file",
Expand Down Expand Up @@ -7920,6 +7921,7 @@
"headers": [],
"generatedRequestName": "EditContractDocumentRequest",
"request": {
"description": "This is the file you will upload in a multi-part form.",
"properties": [
{
"key": "file",
Expand Down
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": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@
"headers": [],
"generatedRequestName": "MultipartFileUploadStartRequest",
"request": {
"description": "Multipart upload parameters to start multipart uploading.",
"properties": [
{
"key": "UPLOADCARE_PUB_KEY",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13551,6 +13551,7 @@ docs: The Contracts resource lets you create, amend and, retrieve Deel contracts
},
},
"content-type": "multipart/form-data",
"docs": "This is the file you will upload in a multi-part form.",
"headers": undefined,
"name": "AddContractDocumentRequest",
"query-parameters": undefined,
Expand Down Expand Up @@ -13779,6 +13780,7 @@ docs: The Contracts resource lets you create, amend and, retrieve Deel contracts
},
},
"content-type": "multipart/form-data",
"docs": "This is the file you will upload in a multi-part form.",
"headers": undefined,
"name": "EditContractDocumentRequest",
"query-parameters": undefined,
Expand Down Expand Up @@ -14634,6 +14636,7 @@ service:
properties:
file: optional<file>
content-type: multipart/form-data
docs: This is the file you will upload in a multi-part form.
response:
docs: Successful operation.
type: root.ContractDocumentContainer
Expand Down Expand Up @@ -14672,6 +14675,7 @@ service:
properties:
file: optional<file>
content-type: multipart/form-data
docs: This is the file you will upload in a multi-part form.
response:
docs: Successful operation.
type: root.ContractDocumentContainer
Expand Down
Loading

0 comments on commit 8b1f8a1

Please sign in to comment.