-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix): a single enum with x-fern-enum is not turned into a literal (#…
- Loading branch information
Showing
4 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/cli/openapi-ir-to-fern/src/__test__/__snapshots__/x-fern-enum.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,30 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`x-fern-enum x-fern-enum simple 1`] = ` | ||
{ | ||
"definitionFiles": { | ||
"transcripts.yml": { | ||
"types": { | ||
"SpeechModel": { | ||
"docs": "The speech model to use for the transcription.", | ||
"enum": [ | ||
{ | ||
"docs": "The Nano tier is a lightweight model that is optimized for speed and cost.", | ||
"name": "Nano", | ||
"value": "nano", | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
"packageMarkerFile": {}, | ||
"rootApiFile": { | ||
"display-name": "Test extension \`x-fern-enum\` for enums", | ||
"error-discrimination": { | ||
"strategy": "status-code", | ||
}, | ||
"name": "api", | ||
}, | ||
} | ||
`; |
17 changes: 17 additions & 0 deletions
17
packages/cli/openapi-ir-to-fern/src/__test__/fixtures/x-fern-enum/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,17 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Test extension `x-fern-enum` for enums | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
SpeechModel: | ||
type: string | ||
description: The speech model to use for the transcription. | ||
x-fern-sdk-group-name: transcripts | ||
enum: | ||
- nano | ||
x-fern-enum: | ||
nano: | ||
name: Nano | ||
description: The Nano tier is a lightweight model that is optimized for speed and cost. |
5 changes: 5 additions & 0 deletions
5
packages/cli/openapi-ir-to-fern/src/__test__/x-fern-enum.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-enum", () => { | ||
testConvertOpenAPI("x-fern-enum", "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