Skip to content

Commit b9339d3

Browse files
feat(cli): add binary type support to Conjure parser (#10369)
1 parent 5e8d1e3 commit b9339d3

File tree

8 files changed

+87
-12
lines changed

8 files changed

+87
-12
lines changed

packages/cli/api-importers/conjure/conjure-sdk/fern/definition/types.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ types:
7575
- integer
7676
- double
7777
- boolean
78+
- binary

packages/cli/api-importers/conjure/conjure-sdk/src/sdk/api/resources/types/types/ConjurePrimitive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
export type ConjurePrimitive = "rid" | "string" | "safelong" | "integer" | "double" | "boolean";
5+
export type ConjurePrimitive = "rid" | "string" | "safelong" | "integer" | "double" | "boolean" | "binary";
66
export const ConjurePrimitive = {
77
Rid: "rid",
88
String: "string",
99
Safelong: "safelong",
1010
Integer: "integer",
1111
Double: "double",
1212
Boolean: "boolean",
13+
Binary: "binary",
1314
} as const;

packages/cli/api-importers/conjure/conjure-sdk/src/sdk/core/schemas/utils/maybeSkipValidation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function transformAndMaybeSkipValidation<T>(
1515
const transformed = transform(value, opts);
1616
const { skipValidation = false } = opts ?? {};
1717
if (!transformed.ok && skipValidation) {
18-
// biome-ignore lint/suspicious/noConsole: allow console
18+
// eslint-disable-next-line no-console
1919
console.warn(
2020
[
2121
"Failed to validate.",

packages/cli/api-importers/conjure/conjure-sdk/src/sdk/serialization/resources/types/types/ConjurePrimitive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import * as core from "../../../../core";
99
export const ConjurePrimitive: core.serialization.Schema<
1010
serializers.ConjurePrimitive.Raw,
1111
FernConjure.ConjurePrimitive
12-
> = core.serialization.enum_(["rid", "string", "safelong", "integer", "double", "boolean"]);
12+
> = core.serialization.enum_(["rid", "string", "safelong", "integer", "double", "boolean", "binary"]);
1313

1414
export declare namespace ConjurePrimitive {
15-
export type Raw = "rid" | "string" | "safelong" | "integer" | "double" | "boolean";
15+
export type Raw = "rid" | "string" | "safelong" | "integer" | "double" | "boolean" | "binary";
1616
}

packages/cli/api-importers/conjure/conjure-to-fern-tests/__test__/__snapshots__/trace.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3868,7 +3868,7 @@
38683868
},
38693869
"commons/__package__.yml": {
38703870
"absoluteFilepath": "/DUMMY_PATH",
3871-
"rawContents": "types:\n EmptyObject:\n properties: {}\n ProblemId:\n type: string\n NodeId:\n type: string\n VariableType:\n union:\n integerType:\n type: EmptyObject\n key: integerType\n doubleType:\n type: EmptyObject\n key: doubleType\n booleanType:\n type: EmptyObject\n key: booleanType\n stringType:\n type: EmptyObject\n key: stringType\n charType:\n type: EmptyObject\n key: charType\n listType:\n type: ListType\n key: listType\n mapType:\n type: MapType\n key: mapType\n binaryTreeType:\n type: EmptyObject\n key: binaryTreeType\n singlyLinkedListType:\n type: EmptyObject\n key: singlyLinkedListType\n doublyLinkedListType:\n type: EmptyObject\n key: doublyLinkedListType\n ListType:\n properties:\n valueType: VariableType\n isFixedLength:\n docs: >-\n Whether this list is fixed-size (for languages that supports\n fixed-size lists). Defaults to false.\n type: optional<boolean>\n MapType:\n properties:\n keyType: VariableType\n valueType: VariableType\n VariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: MapValue\n key: mapValue\n listValue:\n type: list<VariableValue>\n key: listValue\n binaryTreeValue:\n type: BinaryTreeValue\n key: binaryTreeValue\n singlyLinkedListValue:\n type: SinglyLinkedListValue\n key: singlyLinkedListValue\n doublyLinkedListValue:\n type: DoublyLinkedListValue\n key: doublyLinkedListValue\n nullValue:\n type: EmptyObject\n key: nullValue\n FrontendVariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: FrontendMapValue\n key: mapValue\n listValue:\n type: list<FrontendVariableValue>\n key: listValue\n binaryTreeValue:\n type: FrontendBinaryTreeValue\n key: binaryTreeValue\n singlyLinkedListValue:\n type: FrontendSinglyLinkedListValue\n key: singlyLinkedListValue\n doublyLinkedListValue:\n type: FrontendDoublyLinkedListValue\n key: doublyLinkedListValue\n nullValue:\n type: EmptyObject\n key: nullValue\n DebugVariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: DebugMapValue\n key: mapValue\n listValue:\n type: list<DebugVariableValue>\n key: listValue\n binaryTreeNodeValue:\n type: BinaryTreeNodeAndTreeValue\n key: binaryTreeNodeValue\n singlyLinkedListNodeValue:\n type: SinglyLinkedListNodeAndListValue\n key: singlyLinkedListNodeValue\n doublyLinkedListNodeValue:\n type: DoublyLinkedListNodeAndListValue\n key: doublyLinkedListNodeValue\n undefinedValue:\n type: EmptyObject\n key: undefinedValue\n nullValue:\n type: EmptyObject\n key: nullValue\n genericValue:\n type: GenericValue\n key: genericValue\n GenericValue:\n properties:\n stringifiedType: optional<string>\n stringifiedValue: string\n MapValue:\n properties:\n keyValuePairs: list<KeyValuePair>\n KeyValuePair:\n properties:\n key: VariableValue\n value: VariableValue\n BinaryTreeValue:\n properties:\n root: optional<NodeId>\n nodes: map<NodeId, BinaryTreeNodeValue>\n BinaryTreeNodeValue:\n properties:\n nodeId: NodeId\n val: double\n right: optional<NodeId>\n left: optional<NodeId>\n BinaryTreeNodeAndTreeValue:\n properties:\n nodeId: NodeId\n fullTree: BinaryTreeValue\n SinglyLinkedListValue:\n properties:\n head: optional<NodeId>\n nodes: map<NodeId, SinglyLinkedListNodeValue>\n SinglyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: double\n next: optional<NodeId>\n SinglyLinkedListNodeAndListValue:\n properties:\n nodeId: NodeId\n fullList: SinglyLinkedListValue\n DoublyLinkedListValue:\n properties:\n head: optional<NodeId>\n nodes: map<NodeId, DoublyLinkedListNodeValue>\n DoublyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: double\n next: optional<NodeId>\n prev: optional<NodeId>\n DoublyLinkedListNodeAndListValue:\n properties:\n nodeId: NodeId\n fullList: DoublyLinkedListValue\n FrontendMapValue:\n properties:\n keyValuePairs: list<FrontendKeyValuePair>\n FrontendKeyValuePair:\n properties:\n key: FrontendVariableValue\n value: FrontendVariableValue\n FrontendBinaryTreeValue:\n properties:\n root: NodeId\n nodes: map<NodeId, FrontendBinaryTreeNodeValue>\n FrontendBinaryTreeNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n right: optional<NodeId>\n left: optional<NodeId>\n FrontendSinglyLinkedListValue:\n properties:\n head: NodeId\n nodes: map<NodeId, FrontendSinglyLinkedListNodeValue>\n FrontendSinglyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n next: optional<NodeId>\n FrontendDoublyLinkedListValue:\n properties:\n head: NodeId\n nodes: map<NodeId, FrontendDoublyLinkedListNodeValue>\n FrontendDoublyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n next: optional<NodeId>\n prev: optional<NodeId>\n DebugMapValue:\n properties:\n keyValuePairs: list<DebugKeyValuePairs>\n DebugKeyValuePairs:\n properties:\n key: DebugVariableValue\n value: DebugVariableValue\n TestCase:\n properties:\n id: string\n params: list<VariableValue>\n TestCaseWithExpectedResult:\n properties:\n testCase: TestCase\n expectedResult: VariableValue\n FileInfo:\n properties:\n filename: string\n contents: string\n Language:\n enum:\n - JAVA\n - JAVASCRIPT\n - PYTHON\n UserId:\n type: string\n",
3871+
"rawContents": "types:\n EmptyObject:\n properties: {}\n ProblemId:\n type: string\n NodeId:\n type: string\n VariableType:\n union:\n integerType:\n type: EmptyObject\n key: integerType\n doubleType:\n type: EmptyObject\n key: doubleType\n booleanType:\n type: EmptyObject\n key: booleanType\n stringType:\n type: EmptyObject\n key: stringType\n charType:\n type: EmptyObject\n key: charType\n listType:\n type: ListType\n key: listType\n mapType:\n type: MapType\n key: mapType\n binaryTreeType:\n type: EmptyObject\n key: binaryTreeType\n singlyLinkedListType:\n type: EmptyObject\n key: singlyLinkedListType\n doublyLinkedListType:\n type: EmptyObject\n key: doublyLinkedListType\n ListType:\n properties:\n valueType: VariableType\n isFixedLength:\n docs: >-\n Whether this list is fixed-size (for languages that supports\n fixed-size lists). Defaults to false.\n type: optional<boolean>\n MapType:\n properties:\n keyType: VariableType\n valueType: VariableType\n VariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: MapValue\n key: mapValue\n listValue:\n type: list<VariableValue>\n key: listValue\n binaryTreeValue:\n type: BinaryTreeValue\n key: binaryTreeValue\n singlyLinkedListValue:\n type: SinglyLinkedListValue\n key: singlyLinkedListValue\n doublyLinkedListValue:\n type: DoublyLinkedListValue\n key: doublyLinkedListValue\n nullValue:\n type: EmptyObject\n key: nullValue\n FrontendVariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: FrontendMapValue\n key: mapValue\n listValue:\n type: list<FrontendVariableValue>\n key: listValue\n binaryTreeValue:\n type: FrontendBinaryTreeValue\n key: binaryTreeValue\n singlyLinkedListValue:\n type: FrontendSinglyLinkedListValue\n key: singlyLinkedListValue\n doublyLinkedListValue:\n type: FrontendDoublyLinkedListValue\n key: doublyLinkedListValue\n nullValue:\n type: EmptyObject\n key: nullValue\n DebugVariableValue:\n union:\n integerValue:\n type: integer\n key: integerValue\n booleanValue:\n type: boolean\n key: booleanValue\n doubleValue:\n type: double\n key: doubleValue\n stringValue:\n type: string\n key: stringValue\n charValue:\n type: string\n key: charValue\n mapValue:\n type: DebugMapValue\n key: mapValue\n listValue:\n type: list<DebugVariableValue>\n key: listValue\n binaryTreeNodeValue:\n type: BinaryTreeNodeAndTreeValue\n key: binaryTreeNodeValue\n singlyLinkedListNodeValue:\n type: SinglyLinkedListNodeAndListValue\n key: singlyLinkedListNodeValue\n doublyLinkedListNodeValue:\n type: DoublyLinkedListNodeAndListValue\n key: doublyLinkedListNodeValue\n undefinedValue:\n type: EmptyObject\n key: undefinedValue\n nullValue:\n type: EmptyObject\n key: nullValue\n genericValue:\n type: GenericValue\n key: genericValue\n GenericValue:\n properties:\n stringifiedType: optional<string>\n stringifiedValue: string\n MapValue:\n properties:\n keyValuePairs: list<KeyValuePair>\n KeyValuePair:\n properties:\n key: VariableValue\n value: VariableValue\n BinaryTreeValue:\n properties:\n root: optional<NodeId>\n nodes: map<NodeId, BinaryTreeNodeValue>\n BinaryTreeNodeValue:\n properties:\n nodeId: NodeId\n val: double\n right: optional<NodeId>\n left: optional<NodeId>\n BinaryTreeNodeAndTreeValue:\n properties:\n nodeId: NodeId\n fullTree: BinaryTreeValue\n SinglyLinkedListValue:\n properties:\n head: optional<NodeId>\n nodes: map<NodeId, SinglyLinkedListNodeValue>\n SinglyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: double\n next: optional<NodeId>\n SinglyLinkedListNodeAndListValue:\n properties:\n nodeId: NodeId\n fullList: SinglyLinkedListValue\n DoublyLinkedListValue:\n properties:\n head: optional<NodeId>\n nodes: map<NodeId, DoublyLinkedListNodeValue>\n DoublyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: double\n next: optional<NodeId>\n prev: optional<NodeId>\n DoublyLinkedListNodeAndListValue:\n properties:\n nodeId: NodeId\n fullList: DoublyLinkedListValue\n FrontendMapValue:\n properties:\n keyValuePairs: list<FrontendKeyValuePair>\n FrontendKeyValuePair:\n properties:\n key: FrontendVariableValue\n value: FrontendVariableValue\n FrontendBinaryTreeValue:\n properties:\n root: NodeId\n nodes: map<NodeId, FrontendBinaryTreeNodeValue>\n FrontendBinaryTreeNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n right: optional<NodeId>\n left: optional<NodeId>\n FrontendSinglyLinkedListValue:\n properties:\n head: NodeId\n nodes: map<NodeId, FrontendSinglyLinkedListNodeValue>\n FrontendSinglyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n next: optional<NodeId>\n FrontendDoublyLinkedListValue:\n properties:\n head: NodeId\n nodes: map<NodeId, FrontendDoublyLinkedListNodeValue>\n FrontendDoublyLinkedListNodeValue:\n properties:\n nodeId: NodeId\n val: optional<double>\n next: optional<NodeId>\n prev: optional<NodeId>\n DebugMapValue:\n properties:\n keyValuePairs: list<DebugKeyValuePairs>\n DebugKeyValuePairs:\n properties:\n key: DebugVariableValue\n value: DebugVariableValue\n TestCase:\n properties:\n id: string\n params: list<VariableValue>\n TestCaseWithExpectedResult:\n properties:\n testCase: TestCase\n expectedResult: VariableValue\n FileInfo:\n properties:\n filename: string\n contents: string\n Language:\n enum:\n - JAVA\n - JAVASCRIPT\n - PYTHON\n UserId:\n type: string\n BinaryData:\n properties:\n data:\n type: string\n docs: Raw binary data\n validation:\n format: binary\n metadata: string\n BinaryAlias:\n type: string\n validation:\n format: binary\n",
38723872
"contents": {
38733873
"types": {
38743874
"EmptyObject": {
@@ -4257,6 +4257,24 @@
42574257
},
42584258
"UserId": {
42594259
"type": "string"
4260+
},
4261+
"BinaryData": {
4262+
"properties": {
4263+
"data": {
4264+
"type": "string",
4265+
"docs": "Raw binary data",
4266+
"validation": {
4267+
"format": "binary"
4268+
}
4269+
},
4270+
"metadata": "string"
4271+
}
4272+
},
4273+
"BinaryAlias": {
4274+
"type": "string",
4275+
"validation": {
4276+
"format": "binary"
4277+
}
42604278
}
42614279
}
42624280
}

packages/cli/api-importers/conjure/conjure-to-fern-tests/__test__/fixtures/trace/conjure/commons.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,11 @@ types:
186186

187187
UserId:
188188
alias: string
189+
BinaryData:
190+
fields:
191+
data:
192+
type: binary
193+
docs: Raw binary data
194+
metadata: string
195+
BinaryAlias:
196+
alias: binary

0 commit comments

Comments
 (0)