mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-01 23:04:29 +00:00
refactor(codemode): simplify input conflict detection (#46465)
This commit is contained in:
parent
c0220ddd8b
commit
57a9decefe
2 changed files with 5 additions and 4 deletions
|
|
@ -461,9 +461,7 @@ export const operationInput = (
|
|||
const fields = [...parameters.value, ...requestBody.value.fields]
|
||||
|
||||
const conflicts = new Set(
|
||||
[...Map.groupBy(fields, (field) => field.name)]
|
||||
.filter(([, matches]) => new Set(matches.map((field) => field.location)).size > 1)
|
||||
.map(([name]) => name),
|
||||
[...Map.groupBy(fields, (field) => field.name)].filter(([, matches]) => matches.length > 1).map(([name]) => name),
|
||||
)
|
||||
const used = new Set<string>()
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -319,7 +319,10 @@ describe("OpenAPI.fromSpec", () => {
|
|||
parameters: [{ name: "limit", in: "query", schema: { type: "string" } }],
|
||||
get: {
|
||||
operationId: "test",
|
||||
parameters: [{ name: "limit", in: "query", required: true, schema: { type: "number" } }],
|
||||
parameters: [
|
||||
{ name: "limit", in: "query", schema: { type: "boolean" } },
|
||||
{ name: "limit", in: "query", required: true, schema: { type: "number" } },
|
||||
],
|
||||
responses: { 200: { description: "Success" } },
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue