Skip to content

Commit 8ea6bd0

Browse files
koriyoshi2041claude
andcommitted
feat: track parameter location (path/query/body) in IR
Add ParameterLocation type and `in` field to SchemaProperty so emitters can distinguish query params from body params for proper URL construction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6bf8eb3 commit 8ea6bd0

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/parser/openapi-parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ function extractRequestBodyProperties(
404404
type: prop.type?.toString() ?? "string",
405405
description: desc,
406406
required: isRequired,
407+
in: "body",
407408
format: prop.format,
408409
enum: prop.enum as string[] | undefined,
409410
default: prop.default,
@@ -434,6 +435,7 @@ function extractRequestBodyProperties(
434435
type: schemaType,
435436
description: desc,
436437
required: isBodyRequired,
438+
in: "body",
437439
format: schema.format,
438440
example: schema.example,
439441
});

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ export interface AuthRequirement {
3030

3131
// ─── Schema ──────────────────────────────────────────────
3232

33+
export type ParameterLocation = "path" | "query" | "header" | "cookie" | "body";
34+
3335
export interface SchemaProperty {
3436
readonly name: string;
3537
readonly type: string;
3638
readonly description: string;
3739
readonly required: boolean;
40+
readonly in?: ParameterLocation;
3841
readonly format?: string;
3942
readonly enum?: readonly string[];
4043
readonly default?: unknown;

0 commit comments

Comments
 (0)