-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat, openapi): add support for
x-fern-idempotency-headers
(#3746)
- Loading branch information
Showing
65 changed files
with
1,623 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
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
12 changes: 12 additions & 0 deletions
12
packages/cli/openapi-ir-sdk/src/sdk/api/resources/finalIr/types/IdempotencyHeader.ts
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,12 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
|
||
import * as FernOpenapiIr from "../../.."; | ||
|
||
export interface IdempotencyHeader { | ||
header: string; | ||
name: string | undefined; | ||
env: string | undefined; | ||
schema: FernOpenapiIr.Schema | undefined; | ||
} |
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
1 change: 1 addition & 0 deletions
1
packages/cli/openapi-ir-sdk/src/sdk/api/resources/finalIr/types/index.ts
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
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
26 changes: 26 additions & 0 deletions
26
...ges/cli/openapi-ir-sdk/src/sdk/serialization/resources/finalIr/types/IdempotencyHeader.ts
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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
|
||
import * as serializers from "../../.."; | ||
import * as FernOpenapiIr from "../../../../api"; | ||
import * as core from "../../../../core"; | ||
|
||
export const IdempotencyHeader: core.serialization.ObjectSchema< | ||
serializers.IdempotencyHeader.Raw, | ||
FernOpenapiIr.IdempotencyHeader | ||
> = core.serialization.objectWithoutOptionalProperties({ | ||
header: core.serialization.string(), | ||
name: core.serialization.string().optional(), | ||
env: core.serialization.string().optional(), | ||
schema: core.serialization.lazy(async () => (await import("../../..")).Schema).optional(), | ||
}); | ||
|
||
export declare namespace IdempotencyHeader { | ||
interface Raw { | ||
header: string; | ||
name?: string | null; | ||
env?: string | null; | ||
schema?: serializers.Schema.Raw | null; | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
packages/cli/openapi-ir-sdk/src/sdk/serialization/resources/finalIr/types/index.ts
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
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
127 changes: 127 additions & 0 deletions
127
...cli/openapi-ir-to-fern/src/__test__/__snapshots__/x-fern-idempotency-headers.test.ts.snap
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,127 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`x-fern-idempotency-headers x-fern-idempotency-headers docs 1`] = ` | ||
{ | ||
"definitionFiles": {}, | ||
"packageMarkerFile": { | ||
"service": { | ||
"auth": false, | ||
"base-path": "", | ||
"endpoints": { | ||
"send": { | ||
"auth": false, | ||
"docs": undefined, | ||
"examples": [ | ||
{ | ||
"request": {}, | ||
"response": { | ||
"body": "string", | ||
}, | ||
}, | ||
], | ||
"idempotent": true, | ||
"method": "POST", | ||
"pagination": undefined, | ||
"path": "/send", | ||
"request": { | ||
"body": { | ||
"properties": { | ||
"send": { | ||
"audiences": [ | ||
"public", | ||
], | ||
"docs": undefined, | ||
"type": "optional<boolean>", | ||
}, | ||
}, | ||
}, | ||
"headers": undefined, | ||
"name": "SendRequest", | ||
"query-parameters": undefined, | ||
}, | ||
"response": { | ||
"docs": "Success!", | ||
"type": "string", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
"rootApiFile": { | ||
"display-name": "Test extension \`x-fern-audiences\` alongside \`x-fern-streaming\`.", | ||
"error-discrimination": { | ||
"strategy": "status-code", | ||
}, | ||
"idempotency-headers": { | ||
"Idempotency-Key": { | ||
"name": "idempotencyKey", | ||
"type": "optional<string>", | ||
}, | ||
}, | ||
"name": "api", | ||
}, | ||
} | ||
`; | ||
|
||
exports[`x-fern-idempotency-headers x-fern-idempotency-headers simple 1`] = ` | ||
{ | ||
"definitionFiles": {}, | ||
"packageMarkerFile": { | ||
"service": { | ||
"auth": false, | ||
"base-path": "", | ||
"endpoints": { | ||
"send": { | ||
"auth": false, | ||
"docs": undefined, | ||
"examples": [ | ||
{ | ||
"request": {}, | ||
"response": { | ||
"body": "string", | ||
}, | ||
}, | ||
], | ||
"idempotent": true, | ||
"method": "POST", | ||
"pagination": undefined, | ||
"path": "/send", | ||
"request": { | ||
"body": { | ||
"properties": { | ||
"send": { | ||
"audiences": [ | ||
"public", | ||
], | ||
"docs": undefined, | ||
"type": "optional<boolean>", | ||
}, | ||
}, | ||
}, | ||
"headers": undefined, | ||
"name": "SendRequest", | ||
"query-parameters": undefined, | ||
}, | ||
"response": { | ||
"docs": "Success!", | ||
"type": "string", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
"rootApiFile": { | ||
"display-name": "Test extension \`x-fern-audiences\` alongside \`x-fern-streaming\`.", | ||
"error-discrimination": { | ||
"strategy": "status-code", | ||
}, | ||
"idempotency-headers": { | ||
"Idempotency-Key": { | ||
"name": "idempotencyKey", | ||
"type": "optional<string>", | ||
}, | ||
}, | ||
"name": "api", | ||
}, | ||
} | ||
`; |
29 changes: 29 additions & 0 deletions
29
packages/cli/openapi-ir-to-fern/src/__test__/fixtures/x-fern-idempotency-headers/openapi.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,29 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Test extension `x-fern-audiences` alongside `x-fern-streaming`. | ||
version: 1.0.0 | ||
x-fern-idempotency-headers: | ||
- header: Idempotency-Key | ||
paths: | ||
"/send": | ||
post: | ||
x-fern-sdk-method-name: send | ||
x-fern-idempotent: true | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
send: | ||
type: boolean | ||
x-fern-audiences: [ "public" ] | ||
responses: | ||
"200": | ||
description: "Success!" | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
components: | ||
schemas: {} |
5 changes: 5 additions & 0 deletions
5
packages/cli/openapi-ir-to-fern/src/__test__/x-fern-idempotency-headers.test.ts
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 @@ | ||
import { testConvertOpenAPI } from "./testConvertOpenApi"; | ||
|
||
describe("x-fern-idempotency-headers", () => { | ||
testConvertOpenAPI("x-fern-idempotency-headers", "openapi.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
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.