Skip to content

Commit

Permalink
[openapi importer] prioritize application/json and `multipart/form-…
Browse files Browse the repository at this point in the history
…data` (#1893)

* prefer application/json over multipart/form-data

* if both application/json and multipart/form-data are present, then only prefer multipart if there is a file in the body
  • Loading branch information
dsinghvi authored Jul 13, 2023
1 parent c5d2d35 commit 6e1575f
Show file tree
Hide file tree
Showing 6 changed files with 38,051 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4513,14 +4513,13 @@ exports[`open api parser deel simple 1`] = `
},
},
},
"InvoiceAdjustmentToCreateContainer": {
"InvoiceAdjustmentToCreateWithFile": {
"docs": undefined,
"properties": {
"data": {
"docs": undefined,
"type": "InvoiceAdjustmentToCreate",
},
},
"extends": [
"InvoiceAdjustmentToCreate",
"FileObject",
],
"properties": {},
},
"InvoiceAdjustmentToUpdate": {
"docs": "Details of invoice adjustment to update.",
Expand Down Expand Up @@ -5234,14 +5233,13 @@ exports[`open api parser deel simple 1`] = `
"docs": undefined,
"type": "MilestoneProperties",
},
"MilestoneToCreateContainer": {
"MilestoneToCreateFormWithFile": {
"docs": undefined,
"properties": {
"data": {
"docs": undefined,
"type": "MilestoneToCreate",
},
},
"extends": [
"MilestoneProperties",
"FileObject",
],
"properties": {},
},
"MonthlyPayment": {
"docs": "Monthly payment details for the user",
Expand Down Expand Up @@ -6977,15 +6975,6 @@ exports[`open api parser deel simple 1`] = `
"docs": undefined,
"type": "TimesheetSharedProperties",
},
"TimesheetToCreateContainer": {
"docs": undefined,
"properties": {
"data": {
"docs": undefined,
"type": "TimesheetToCreate",
},
},
},
"TimesheetToCreateContainerWithFile": {
"docs": undefined,
"type": "TimesheetToCreateWithFile",
Expand Down Expand Up @@ -8722,10 +8711,15 @@ exports[`open api parser deel simple 1`] = `
"path": "/invoice-adjustments",
"request": {
"body": {
"properties": {},
"properties": {
"data": {
"docs": undefined,
"type": "root.InvoiceAdjustmentToCreate",
},
},
},
"headers": undefined,
"name": "InvoiceAdjustmentToCreateWithFile",
"name": "InvoiceAdjustmentToCreateContainer",
"query-parameters": undefined,
},
"response": {
Expand Down Expand Up @@ -9229,10 +9223,15 @@ exports[`open api parser deel simple 1`] = `
},
"request": {
"body": {
"properties": {},
"properties": {
"data": {
"docs": undefined,
"type": "root.MilestoneToCreate",
},
},
},
"headers": undefined,
"name": "MilestoneToCreateFormWithFile",
"name": "MilestoneToCreateContainer",
"query-parameters": undefined,
},
"response": {
Expand Down Expand Up @@ -10115,10 +10114,15 @@ exports[`open api parser deel simple 1`] = `
"path": "/timesheets",
"request": {
"body": {
"properties": {},
"properties": {
"data": {
"docs": undefined,
"type": "root.TimesheetToCreate",
},
},
},
"headers": undefined,
"name": "CreateTimesheetRequest",
"name": "TimesheetToCreateContainer",
"query-parameters": undefined,
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2069,9 +2069,15 @@ exports[`open api parser deel parse open api 1`] = `
"queryParameters": [],
"request": {
"description": undefined,
"name": "MilestoneToCreateFormWithFile",
"properties": [],
"type": "multipart",
"schema": {
"description": undefined,
"file": undefined,
"generatedName": "CreateMilestoneRequest",
"nameOverride": undefined,
"schema": "MilestoneToCreateContainer",
"type": "reference",
},
"type": "json",
},
"requestNameOverride": undefined,
"response": {
Expand Down Expand Up @@ -3391,9 +3397,15 @@ exports[`open api parser deel parse open api 1`] = `
"queryParameters": [],
"request": {
"description": undefined,
"name": undefined,
"properties": [],
"type": "multipart",
"schema": {
"description": undefined,
"file": undefined,
"generatedName": "CreateTimesheetRequest",
"nameOverride": undefined,
"schema": "TimesheetToCreateContainer",
"type": "reference",
},
"type": "json",
},
"requestNameOverride": undefined,
"response": {
Expand Down Expand Up @@ -4157,9 +4169,15 @@ exports[`open api parser deel parse open api 1`] = `
"queryParameters": [],
"request": {
"description": undefined,
"name": "InvoiceAdjustmentToCreateWithFile",
"properties": [],
"type": "multipart",
"schema": {
"description": undefined,
"file": undefined,
"generatedName": "CreateInvoiceAdjustmentRequest",
"nameOverride": undefined,
"schema": "InvoiceAdjustmentToCreateContainer",
"type": "reference",
},
"type": "json",
},
"requestNameOverride": undefined,
"response": {
Expand Down
Loading

0 comments on commit 6e1575f

Please sign in to comment.