-
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):
content-type
defaults to first value when provided as com…
…ma-delineated string (#5219) * Build endpoint uses first content-type value when provided a comma-delineated list. * chore: update changelog --------- Co-authored-by: fern-bot <[email protected]>
- Loading branch information
Showing
10 changed files
with
554 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## 0.45.0-rc45 | ||
## 0.45.0-rc46 | ||
**`(fix):`** The IR handles converting example unions that are aliases. | ||
|
||
|
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-rc47 | ||
**`(fix):`** Support SDK generation provided comma-delineated content-type values in OpenAPI specs. | ||
|
||
|
142 changes: 142 additions & 0 deletions
142
...penapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-docs/content-type.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,142 @@ | ||
{ | ||
"absoluteFilePath": "/DUMMY_PATH", | ||
"importedDefinitions": {}, | ||
"namedDefinitionFiles": { | ||
"__package__.yml": { | ||
"absoluteFilepath": "/DUMMY_PATH", | ||
"contents": { | ||
"service": { | ||
"auth": false, | ||
"base-path": "", | ||
"endpoints": { | ||
"testUpload": { | ||
"auth": false, | ||
"display-name": "Test upload", | ||
"docs": "Test multipart request with different content types. | ||
", | ||
"examples": [ | ||
{ | ||
"path-parameters": { | ||
"corpus_key": "corpus_key", | ||
}, | ||
"request": {}, | ||
"response": { | ||
"body": "string", | ||
}, | ||
}, | ||
], | ||
"method": "POST", | ||
"pagination": undefined, | ||
"path": "/test", | ||
"path-parameters": { | ||
"corpus_key": { | ||
"docs": "The unique key", | ||
"type": "string", | ||
}, | ||
}, | ||
"request": { | ||
"body": { | ||
"properties": { | ||
"chunking_strategy": "optional<unknown>", | ||
"file": { | ||
"content-type": "application/octet-stream", | ||
"docs": "Binary file contents. The file name of the file will be used as the document ID.", | ||
"type": "file", | ||
}, | ||
"filename": { | ||
"docs": "Optional multipart section to override the filename.", | ||
"type": "optional<string>", | ||
}, | ||
"metadata": { | ||
"docs": "Arbitrary object that will be attached as document metadata to the extracted document.", | ||
"type": "optional<map<string, unknown>>", | ||
}, | ||
}, | ||
}, | ||
"content-type": "multipart/form-data", | ||
"headers": undefined, | ||
"name": "PostTestRequest", | ||
"query-parameters": undefined, | ||
}, | ||
"response": { | ||
"docs": "The sample response", | ||
"type": "string", | ||
}, | ||
"source": { | ||
"openapi": "../openapi.yml", | ||
}, | ||
}, | ||
}, | ||
"source": { | ||
"openapi": "../openapi.yml", | ||
}, | ||
}, | ||
}, | ||
"rawContents": "service: | ||
auth: false | ||
base-path: '' | ||
endpoints: | ||
testUpload: | ||
path: /test | ||
method: POST | ||
auth: false | ||
docs: | | ||
Test multipart request with different content types. | ||
source: | ||
openapi: ../openapi.yml | ||
path-parameters: | ||
corpus_key: | ||
type: string | ||
docs: The unique key | ||
display-name: Test upload | ||
request: | ||
name: PostTestRequest | ||
body: | ||
properties: | ||
metadata: | ||
type: optional<map<string, unknown>> | ||
docs: >- | ||
Arbitrary object that will be attached as document metadata to | ||
the extracted document. | ||
chunking_strategy: optional<unknown> | ||
filename: | ||
type: optional<string> | ||
docs: Optional multipart section to override the filename. | ||
file: | ||
type: file | ||
docs: >- | ||
Binary file contents. The file name of the file will be used as | ||
the document ID. | ||
content-type: application/octet-stream | ||
content-type: multipart/form-data | ||
response: | ||
docs: The sample response | ||
type: string | ||
examples: | ||
- path-parameters: | ||
corpus_key: corpus_key | ||
request: {} | ||
response: | ||
body: string | ||
source: | ||
openapi: ../openapi.yml | ||
", | ||
}, | ||
}, | ||
"packageMarkers": {}, | ||
"rootApiFile": { | ||
"contents": { | ||
"display-name": "Test content-type parsing.", | ||
"error-discrimination": { | ||
"strategy": "status-code", | ||
}, | ||
"name": "api", | ||
}, | ||
"defaultUrl": undefined, | ||
"rawContents": "name: api | ||
error-discrimination: | ||
strategy: status-code | ||
display-name: Test content-type parsing. | ||
", | ||
}, | ||
} |
195 changes: 195 additions & 0 deletions
195
.../openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/content-type.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,195 @@ | ||
{ | ||
"title": "Test content-type parsing.", | ||
"servers": [], | ||
"tags": { | ||
"tagsById": {} | ||
}, | ||
"hasEndpointsMarkedInternal": false, | ||
"endpoints": [ | ||
{ | ||
"summary": "Test upload", | ||
"audiences": [], | ||
"tags": [], | ||
"pathParameters": [ | ||
{ | ||
"description": "The unique key", | ||
"name": "corpus_key", | ||
"schema": { | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"generatedName": "PostTestRequestCorpusKey", | ||
"groupName": [], | ||
"type": "primitive" | ||
}, | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
} | ||
} | ||
], | ||
"queryParameters": [], | ||
"headers": [], | ||
"generatedRequestName": "PostTestRequest", | ||
"request": { | ||
"properties": [ | ||
{ | ||
"key": "metadata", | ||
"schema": { | ||
"value": { | ||
"generatedName": "postTestRequestMetadata", | ||
"value": { | ||
"generatedName": "PostTestRequestMetadata", | ||
"description": "Arbitrary object that will be attached as document metadata to the extracted document.", | ||
"key": { | ||
"generatedName": "PostTestRequestMetadataKey", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"value": { | ||
"generatedName": "PostTestRequestMetadataValue", | ||
"type": "unknown" | ||
}, | ||
"groupName": [], | ||
"type": "map" | ||
}, | ||
"groupName": [], | ||
"type": "optional" | ||
}, | ||
"type": "json" | ||
} | ||
}, | ||
{ | ||
"key": "chunking_strategy", | ||
"schema": { | ||
"value": { | ||
"generatedName": "postTestRequestChunkingStrategy", | ||
"value": { | ||
"generatedName": "PostTestRequestChunkingStrategy", | ||
"schema": "ChunkingStrategy", | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "reference" | ||
}, | ||
"groupName": [], | ||
"type": "optional" | ||
}, | ||
"type": "json" | ||
} | ||
}, | ||
{ | ||
"key": "filename", | ||
"schema": { | ||
"value": { | ||
"generatedName": "postTestRequestFilename", | ||
"value": { | ||
"generatedName": "PostTestRequestFilename", | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"description": "Optional multipart section to override the filename.", | ||
"groupName": [], | ||
"type": "primitive" | ||
}, | ||
"groupName": [], | ||
"type": "optional" | ||
}, | ||
"type": "json" | ||
} | ||
}, | ||
{ | ||
"key": "file", | ||
"schema": { | ||
"isOptional": false, | ||
"isArray": false, | ||
"type": "file" | ||
}, | ||
"description": "Binary file contents. The file name of the file will be used as the document ID.", | ||
"contentType": "application/octet-stream, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.oasis.opendocument.text, application/epub+zip, application/rtf, text/html, text/plain, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, text/markdown" | ||
} | ||
], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "multipart" | ||
}, | ||
"response": { | ||
"description": "The sample response", | ||
"schema": { | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"generatedName": "PostTestResponse", | ||
"groupName": [], | ||
"type": "primitive" | ||
}, | ||
"fullExamples": [], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
}, | ||
"type": "json" | ||
}, | ||
"errors": {}, | ||
"server": [], | ||
"description": "Test multipart request with different content types.\n", | ||
"authed": false, | ||
"method": "POST", | ||
"path": "/test", | ||
"examples": [ | ||
{ | ||
"pathParameters": [ | ||
{ | ||
"name": "corpus_key", | ||
"value": { | ||
"value": { | ||
"value": "corpus_key", | ||
"type": "string" | ||
}, | ||
"type": "primitive" | ||
} | ||
} | ||
], | ||
"queryParameters": [], | ||
"headers": [], | ||
"request": { | ||
"properties": {}, | ||
"type": "object" | ||
}, | ||
"response": { | ||
"value": { | ||
"value": { | ||
"value": "string", | ||
"type": "string" | ||
}, | ||
"type": "primitive" | ||
}, | ||
"type": "withoutStreaming" | ||
}, | ||
"codeSamples": [], | ||
"type": "full" | ||
} | ||
], | ||
"source": { | ||
"file": "../openapi.yml", | ||
"type": "openapi" | ||
} | ||
} | ||
], | ||
"webhooks": [], | ||
"channel": [], | ||
"groupedSchemas": { | ||
"rootSchemas": {}, | ||
"namespacedSchemas": {} | ||
}, | ||
"variables": {}, | ||
"nonRequestReferencedSchemas": {}, | ||
"securitySchemes": {}, | ||
"globalHeaders": [], | ||
"idempotencyHeaders": [], | ||
"groups": {} | ||
} |
Oops, something went wrong.