Skip to content

Commit

Permalink
(fix): openapi importer brings in valid file examples (#3334)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Apr 5, 2024
1 parent c8cdb48 commit 2e681d0
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 59 deletions.
16 changes: 8 additions & 8 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion packages/cli/configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@fern-api/core-utils": "workspace:*",
"@fern-api/fdr-sdk": "^0.72.0-d986da306",
"@fern-api/fdr-sdk": "^0.73.0-d986da306",
"@fern-api/fs-utils": "workspace:*",
"@fern-api/task-context": "workspace:*",
"@fern-fern/fiddle-sdk": "^0.0.503",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/docs-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@fern-api/configuration": "workspace:*",
"@fern-api/core-utils": "workspace:*",
"@fern-api/fdr-sdk": "^0.72.0-d986da306",
"@fern-api/fdr-sdk": "^0.73.0-d986da306",
"@fern-api/fs-utils": "workspace:*",
"@fern-api/ir-generator": "workspace:*",
"@fern-api/register": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@fern-api/core": "workspace:*",
"@fern-api/core-utils": "workspace:*",
"@fern-api/docs-validator": "workspace:*",
"@fern-api/fdr-sdk": "^0.72.0-d986da306",
"@fern-api/fdr-sdk": "^0.73.0-d986da306",
"@fern-api/fs-utils": "workspace:*",
"@fern-api/ir-generator": "workspace:*",
"@fern-api/ir-migrations": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,43 +316,8 @@ function convertMultipartRequestToSchema(request: RequestWithExample.Multipart):
properties: request.properties
.map((property) => {
if (property.schema.type === "file") {
// TODO: Support file properties in multipart requests
const innerSchema = SchemaWithExample.primitive({
schema: FernOpenapiIr.PrimitiveSchemaValueWithExample.string({
minLength: undefined,
maxLength: undefined,
example: undefined
}),
description: property.description,
nameOverride: undefined,
generatedName: "",
groupName: undefined
});
const maybeArraySchema = property.schema.isArray
? SchemaWithExample.array({
value: innerSchema,
groupName: undefined,
nameOverride: undefined,
generatedName: "",
description: undefined
})
: innerSchema;
const maybeOptionalSchema = property.schema.isOptional
? SchemaWithExample.optional({
value: maybeArraySchema,
groupName: undefined,
nameOverride: undefined,
generatedName: "",
description: undefined
})
: maybeArraySchema;
return {
key: property.key,
schema: maybeOptionalSchema,
audiences: [],
conflict: {},
generatedName: property.key
};
// TODO: Handle file property examples in the Fern Definition
return null;
}
return {
key: property.key,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/register/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@fern-api/configuration": "workspace:*",
"@fern-api/core": "workspace:*",
"@fern-api/core-utils": "workspace:*",
"@fern-api/fdr-sdk": "^0.72.0-d986da306",
"@fern-api/fdr-sdk": "^0.73.0-d986da306",
"@fern-api/ir-generator": "workspace:*",
"@fern-api/ir-sdk": "workspace:*",
"@fern-api/task-context": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"depcheck": "depcheck"
},
"dependencies": {
"@fern-api/fdr-sdk": "^0.72.0-d986da306",
"@fern-api/fdr-sdk": "^0.73.0-d986da306",
"@fern-api/venus-api-sdk": "0.0.38",
"@fern-fern/fiddle-sdk": "^0.0.503"
},
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ __metadata:
resolution: "@fern-api/configuration@workspace:packages/cli/configuration"
dependencies:
"@fern-api/core-utils": "workspace:*"
"@fern-api/fdr-sdk": ^0.72.0-d986da306
"@fern-api/fdr-sdk": ^0.73.0-d986da306
"@fern-api/fs-utils": "workspace:*"
"@fern-api/task-context": "workspace:*"
"@fern-fern/fiddle-sdk": ^0.0.503
Expand Down Expand Up @@ -2454,7 +2454,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@fern-api/core@workspace:packages/core"
dependencies:
"@fern-api/fdr-sdk": ^0.72.0-d986da306
"@fern-api/fdr-sdk": ^0.73.0-d986da306
"@fern-api/venus-api-sdk": 0.0.38
"@fern-fern/fiddle-sdk": ^0.0.503
"@types/jest": ^29.0.3
Expand Down Expand Up @@ -2516,7 +2516,7 @@ __metadata:
dependencies:
"@fern-api/configuration": "workspace:*"
"@fern-api/core-utils": "workspace:*"
"@fern-api/fdr-sdk": ^0.72.0-d986da306
"@fern-api/fdr-sdk": ^0.73.0-d986da306
"@fern-api/fs-utils": "workspace:*"
"@fern-api/ir-generator": "workspace:*"
"@fern-api/register": "workspace:*"
Expand Down Expand Up @@ -2588,9 +2588,9 @@ __metadata:
languageName: unknown
linkType: soft

"@fern-api/fdr-sdk@npm:^0.72.0-d986da306":
version: 0.72.0-fd66273e3
resolution: "@fern-api/fdr-sdk@npm:0.72.0-fd66273e3"
"@fern-api/fdr-sdk@npm:^0.73.0-d986da306":
version: 0.73.0-d986da306
resolution: "@fern-api/fdr-sdk@npm:0.73.0-d986da306"
dependencies:
form-data: 4.0.0
js-base64: 3.7.7
Expand All @@ -2600,7 +2600,7 @@ __metadata:
qs: 6.12.0
tinycolor2: ^1.6.0
url-join: 4.0.1
checksum: f1d473d1f7ebec53be33840732d5e22993d17e1be665596dbbe0b5f9760a98dcb91fab72ba6f4beadacf416e8dc2d6fef0ef7b02af173fc02d62f6deed92d8e9
checksum: 6fad80ce0554aeb049752546a871f8f1f1bc5d70596c48a70bf78cd8cf0bfac13fb7087923ff7d6eb290e3b4bf35e7cd30fdbd4d16abc311b1400945a883a4e1
languageName: node
linkType: hard

Expand Down Expand Up @@ -3228,7 +3228,7 @@ __metadata:
"@fern-api/configuration": "workspace:*"
"@fern-api/core": "workspace:*"
"@fern-api/core-utils": "workspace:*"
"@fern-api/fdr-sdk": ^0.72.0-d986da306
"@fern-api/fdr-sdk": ^0.73.0-d986da306
"@fern-api/ir-generator": "workspace:*"
"@fern-api/ir-sdk": "workspace:*"
"@fern-api/task-context": "workspace:*"
Expand All @@ -3255,7 +3255,7 @@ __metadata:
"@fern-api/core": "workspace:*"
"@fern-api/core-utils": "workspace:*"
"@fern-api/docs-validator": "workspace:*"
"@fern-api/fdr-sdk": ^0.72.0-d986da306
"@fern-api/fdr-sdk": ^0.73.0-d986da306
"@fern-api/fs-utils": "workspace:*"
"@fern-api/ir-generator": "workspace:*"
"@fern-api/ir-migrations": "workspace:*"
Expand Down

0 comments on commit 2e681d0

Please sign in to comment.