| {"id": "patchbench-ts-real-0014", "language": "typescript", "source": "real", "origin": "swe-bench-live-multilang", "upstream_instance_id": "openapi-ts__openapi-typescript-2365", "repo": "openapi-ts/openapi-typescript", "base_commit": "99c346e06bb41511338d2a8c3752748e5d52a742", "issue_text": "Parameters storage is not fulfilled by parameters provided in ApiOperation\nhttps://github.com/openapi-ts/openapi-typescript/blob/99c346e06bb41511338d2a8c3752748e5d52a742/packages/openapi-metadata/src/decorators/api-operation.ts#L13\n\nthus the parameters are not generated when specified\n\n```typescript\n @ApiOperation({\n summary: 'Gets user by id',\n methods: ['get'],\n path: '/users/{id}',\n parameters: [\n {\n name: 'id',\n in: 'path',\n required: true,\n example: 1,\n schema: {\n type: 'integer',\n minimum: 1\n }\n }\n ]\n })\n show(id: string): User {\n return {\n id,\n name: '',\n email: ''\n };\n }\n```\n\nActual Result:\n```json\n{\n \"paths\": {\n \"/users/{id}\": {\n \"get\": {\n \"summary\": \"Gets user by id\",\n \"parameters\": [],\n \"responses\": {},\n \"security\": []\n }\n }\n }\n}\n```\n\nExpected Result: \n```json\n{\n{\n \"paths\": {\n \"/users/{id}\": {\n \"get\": {\n \"summary\": \"Gets user by id\",\n \"parameters\": [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"required\": true,\n \"example\": 1,\n \"schema\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n ],\n \"responses\": {},\n \"security\": []\n }\n }\n }\n}\n```\n", "hints_text": "\n\n", "gold_patch": "diff --git a/.changeset/itchy-jobs-create.md b/.changeset/itchy-jobs-create.md\nnew file mode 100644\nindex 000000000..2b9fe311c\n--- /dev/null\n+++ b/.changeset/itchy-jobs-create.md\n@@ -0,0 +1,5 @@\n+---\n+\"openapi-metadata\": patch\n+---\n+\n+fix(#2364) for allowing to add params via ApiOperation tag\ndiff --git a/packages/openapi-metadata/src/decorators/api-operation.ts b/packages/openapi-metadata/src/decorators/api-operation.ts\nindex 99d210fc8..58995aa14 100644\n--- a/packages/openapi-metadata/src/decorators/api-operation.ts\n+++ b/packages/openapi-metadata/src/decorators/api-operation.ts\n@@ -1,4 +1,8 @@\n-import { type OperationMetadata, OperationMetadataStorage } from \"../metadata/operation.js\";\n+import {\n+ type OperationMetadata,\n+ OperationMetadataStorage,\n+ OperationParameterMetadataStorage,\n+} from \"../metadata/index.js\";\n \n export type ApiOperationOptions = OperationMetadata;\n \n@@ -11,5 +15,8 @@ export type ApiOperationOptions = OperationMetadata;\n export function ApiOperation(options: ApiOperationOptions): MethodDecorator {\n return (target, propertyKey) => {\n OperationMetadataStorage.defineMetadata(target, options, propertyKey);\n+ if (Array.isArray(options.parameters)) {\n+ OperationParameterMetadataStorage.mergeMetadata(target, options.parameters, propertyKey);\n+ }\n };\n }\ndiff --git a/packages/openapi-metadata/src/metadata/operation.ts b/packages/openapi-metadata/src/metadata/operation.ts\nindex a2aafe188..4363a41b8 100644\n--- a/packages/openapi-metadata/src/metadata/operation.ts\n+++ b/packages/openapi-metadata/src/metadata/operation.ts\n@@ -1,8 +1,9 @@\n import type { OpenAPIV3 } from \"openapi-types\";\n import type { HttpMethods } from \"../types.js\";\n import { createMetadataStorage } from \"./factory.js\";\n+import type { OperationParameterMetadata } from \"./operation-parameter.js\";\n \n-export type OperationMetadata = Omit<OpenAPIV3.OperationObject, \"responses\"> & {\n+export type OperationMetadata = Omit<OpenAPIV3.OperationObject, \"responses\" | \"parameters\"> & {\n /**\n * Operation path.\n * Can include parameters.\n@@ -13,6 +14,11 @@ export type OperationMetadata = Omit<OpenAPIV3.OperationObject, \"responses\"> & {\n * Available methods for this operation.\n */\n methods?: HttpMethods[];\n+\n+ /**\n+ * Represents metadata about an operation parameter.\n+ */\n+ parameters?: OperationParameterMetadata[];\n };\n \n export const OperationMetadataKey = Symbol(\"Operation\");\n", "test_patch": "diff --git a/packages/openapi-metadata/test/decorators.test.ts b/packages/openapi-metadata/test/decorators.test.ts\nindex b193be263..87633bb82 100644\n--- a/packages/openapi-metadata/test/decorators.test.ts\n+++ b/packages/openapi-metadata/test/decorators.test.ts\n@@ -1,11 +1,15 @@\n import \"reflect-metadata\";\n import {\n+ ApiBasicAuth,\n+ ApiBearerAuth,\n ApiBody,\n ApiCookie,\n+ ApiCookieAuth,\n ApiExcludeController,\n ApiExcludeOperation,\n ApiExtraModels,\n ApiHeader,\n+ ApiOauth2,\n ApiOperation,\n ApiParam,\n ApiProperty,\n@@ -19,26 +23,40 @@ import {\n ExtraModelsMetadataStorage,\n OperationBodyMetadataStorage,\n OperationMetadataStorage,\n+ type OperationParameterMetadata,\n OperationParameterMetadataStorage,\n OperationResponseMetadataStorage,\n OperationSecurityMetadataStorage,\n PropertyMetadataStorage,\n } from \"../src/metadata/index.js\";\n-import { ApiBasicAuth, ApiBearerAuth, ApiCookieAuth, ApiOauth2 } from \"../src/decorators/api-security.js\";\n \n test(\"@ApiOperation\", () => {\n+ const parameters: OperationParameterMetadata[] = [\n+ {\n+ in: \"path\",\n+ name: \"id\",\n+ },\n+ ] as const;\n+\n class MyController {\n- @ApiOperation({ summary: \"Hello\", path: \"/test\", methods: [\"get\"] })\n+ @ApiOperation({\n+ summary: \"Hello\",\n+ path: \"/test\",\n+ methods: [\"get\"],\n+ parameters,\n+ })\n operation() {}\n }\n \n- const metadata = OperationMetadataStorage.getMetadata(MyController.prototype, \"operation\");\n-\n- expect(metadata).toEqual({\n+ const operationMetadata = OperationMetadataStorage.getMetadata(MyController.prototype, \"operation\");\n+ const parameterMetadata = OperationParameterMetadataStorage.getMetadata(MyController.prototype, \"operation\");\n+ expect(operationMetadata).toEqual({\n summary: \"Hello\",\n path: \"/test\",\n methods: [\"get\"],\n+ parameters,\n });\n+ expect(parameterMetadata).toEqual(parameters);\n });\n \n test(\"@ApiBody\", () => {\n", "fail_to_pass": ["@ApiOperation"], "pass_to_pass": ["createClient options content-type provided default content-type for body-full requests - PUT, 0", "transformPathItemObject parameters > header and cookie have same name param1", "createClient options content-type implicit default content-type for body-full requests - OPTIONS, {}", "request request body `undefined` body (with body serializer) - OPTIONS", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - DELETE, 1", "params query querySerializer array spaceDelimited (explode)", "response data/error `default` is an error", "createClient options content-type provided default content-type for body-full requests - PUT, {}", "transformSchemaObject > object nullable", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - POST, null", "handles HEAD requests with non-zero Content-Length without parsing the body", "Node.js API snapshot > DigitalOcean", "tsEnum with setting: export", "client useQuery uses provided options", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - DELETE, null", "request request body `undefined` body (without body serializer) - PATCH", "openapiTS does not mutate original reference", "request request body `0` body (without body serializer) - PATCH", "types GetResponseContent MixedResponses returns all possible responses", "createClient options content-type implicit default content-type for body-full requests - POST, false", "request request body `undefined` body (without body serializer) - HEAD", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - OPTIONS, false", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PATCH, false", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - POST, false", "response data/error invalid path", "request request body missing body (without body serializer) - OPTIONS", "createClient options content-type implicit default content-type for body-full requests - PATCH, false", "types GetResponseContent MixedResponses returns all OK responses", "response data/error media union text/html", "createClient options content-type specified content-type for body-full requests - POST, {}", "OPTIONS sends the correct method", "openapiTS JSONSchema > $defs are respected", "getEntries options alphabetize: true", "tsEnum name from path", "request request body `false` body (with body serializer) - POST", "transformOperationObject parameters > root optional if no path params and no required params", "request request body `''` body (with body serializer) - DELETE", "request request body `''` body (without body serializer) - POST", "transformSchemaObject > object default > options.defaultNonNullable: false", "createClient options content-type specified content-type for body-full requests - OPTIONS, false", "createClient options content-type no content-type for body-less requests - POST", "transformSchemaObject > object additionalProperties > no properties", "CLI flags --help", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PUT, 0", "client useQuery handles undefined response with zero Content-Length by setting data and error to null", "createClient options content-type implicit default content-type for body-full requests - OPTIONS, false", "oapiRef single part", "transformSchemaObject > object const > number (falsy value)", "@ApiBody", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - DELETE, null", "@ApiSecurity", "createClient options content-type specified content-type for body-full requests - PATCH, 1", "can return response directly from onRequest", "oapiRef reference into paths parameters", "transformSchemaObject > string default + nullable (deprecated syntax)", "createClient options content-type specified content-type for body-full requests - OPTIONS, null", "createInfiniteHook passes correct fetcher to useSWRInfinite", "GET sends correct method", "createClient options content-type specified content-type for body-full requests - PUT, 1", "oapiRef component schema named `properties`", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - OPTIONS, false", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - POST, 0", "GET sends correct options, returns undefined on 204", "openapiTS Generates path parameters", "client useQuery handles undefined response with 204 No Content status by setting data and error to null", "composition discriminator > oneOf", "openapiTS $refs > arbitrary $refs are respected", "transformSchemaObject > string default + nullable", "params query querySerializer array pipeDelimited (explode)", "enum", "params path does not escape allowed characters in path segment", "params query querySerializer object form (explode)", "createMutateHook supports boolean for options argument", "request request body `undefined` body (without body serializer) - PUT", "createClient options content-type no content-type for `undefined` body requests - POST", "params query querySerializer object deepObject (explode)", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PATCH, {}", "composition allOf > basic", "createRef basic", "Node.js API options > pathParamsAsTypes > true", "createClient options content-type implicit default content-type for body-full requests - DELETE, null", "composition discriminator > oneOf + null + implicit mapping", "Invalid schemas Other missing required fields", "addJSDocComment single-line comment", "request request body `false` body (without body serializer) - DELETE", "request request body `null` body (without body serializer) - OPTIONS", "request request body missing body (without body serializer) - DELETE", "types SuccessResponse returns all 2XX responses", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - POST, {}", "request request body missing body (without body serializer) - PATCH", "tsIsPrimitive object", "request request body `''` body (with body serializer) - PUT", "skips onResponse handlers when response is returned from onRequest", "tsEnum string members", "transformPathsObject $ref", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - POST, 0", "transformPathItemObject $ref", "tsEnum number members", "createClient options content-type specified content-type for body-full requests - OPTIONS, {}", "request request body `0` body (without body serializer) - DELETE", "createClient options content-type specified content-type for body-full requests - PATCH, false", "createClient options content-type implicit default content-type for body-full requests - POST, null", "createClient options content-type provided default content-type for body-full requests - OPTIONS, false", "params query querySerializer object deepObject", "transformPathsObjectToEnum basic with path parameter", "transformSchemaObject > array options > arrayLength: true > default", "types GetResponseContent MixedResponses returns correct type for 200 with json-like literal", "transformComponentsObject options > alphabetize: true", "composition discriminator > escape", "transformSchemaObject > number basic", "transformPathsObject options > alphabetize: true", "response parseAs stream", "tsUnion multiple (const)", "createMutateHook with lodash.isMatch as `compare` returns true when init is a subset of key init", "transformSchemaObject > object additionalProperties > true", "executes in expected order", "transformSchemaObject > empty/unknown true", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - DELETE, false", "createMutateHook useMutate -> mutate -> key matcher returns compare result when prefix and path are equal and init is given", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PATCH, 0", "tsEnum x-enum-varnames with numeric prefix", "request request body missing body (without body serializer) - HEAD", "transformSchemaObject > object options > immutable (string)", "DELETE returns empty object on 204", "transformComponentsObject options > excludeDeprecated: true", "openapiTS operations > # character is parsed correctly", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - POST, {}", "transformSchemaObject > object basic", "request request body `application/x-www-form-urlencoded` body", "addJSDocComment escapes internal comments", "createClient options content-type specified content-type for body-full requests - POST, 0", "string", "receives correct options", "client useMutation mutate should resolve data properly and have error as null when mutationFn returns null", "client useSuspenseQuery should resolve data properly and have error as null when successfull request", "request request body `0` body (without body serializer) - PUT", "DELETE sends the correct method", "tsIsPrimitive string", "transformSchemaObject > string enum (whitespace)", "params path allows UTF-8 characters", "@ApiExtraModels", "transformPathsObjectToEnum invalid method", "composition oneOf > string const", "POST sends correct options, returns success", "createClient options content-type provided default content-type for body-full requests - PATCH, null", "transformResponseObject empty", "YAML features not ignore path item components in paths", "openapiTS $refs > basic", "transformSchemaObject > string basic", "Node.js API options > transform", "transformSchemaObject > array options > arrayLength: true > minItems: 1", "transformSchemaObject > string enum (quotes)", "tsIsPrimitive null", "CLI snapshot > Stripe API", "params path serializes", "Node.js API options > transform with optional blob property", "request request body `false` body (with body serializer) - PATCH", "types ErrorResponse returns all 5XX and 4xx responses", "createPathBasedClient path based client provides a PathBasedClient type", "composition allOf > core properties", "client useQuery params should be required if OpenAPI schema requires params", "request request body `undefined` body (with body serializer) - PUT", "composition oneOf > number const", "transformPathItemObject basic", "openapiTS $refs > path object & paths enum", "params query querySerializer function per-request", "Node.js API options > transform with schema object", "request request body `null` body (with body serializer) - PATCH", "transformWebhooksObject $ref", "createClient options content-type specified content-type for body-full requests - DELETE, {}", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - POST, 1", "response data/error media union multiple", "params path typechecks (empty path params)", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - OPTIONS, {}", "request request body `undefined` body (without body serializer) - POST", "composition polymorphic > enum + nullable", "@ApiExcludeOperation", "client useMutation mutate should use provided custom queryClient", "createClient options content-type implicit default content-type for body-full requests - POST, 1", "transformRequestBodyObject POST data with default values", "Node.js API input > string > YAML", "createClient options content-type provided default content-type for body-full requests - OPTIONS, 1", "createClient options content-type provided default content-type for body-full requests - POST, 0", "types GetResponseContent MixedResponses returns correct type for 200 with application/json", "CLI snapshot > GitHub API (next)", "3.1 discriminators allOf > inline inheritance", "transformComponentsObject options > rootTypes: true", "transformSchemaObject > array nullable (deprecated syntax)", "openapiTS TypeScript > WithRequired type helper", "params query querySerializer array spaceDelimited", "transformOperationObject parameters, responses > test excludeDeprecated option", "createClient options content-type provided default content-type for body-full requests - DELETE, null", "transformSchemaObject > array nullable items (deprecated syntax)", "createClient options content-type implicit default content-type for body-full requests - PATCH, 0", "request uses provided Request class", "receives the original request", "request request body `0` body (without body serializer) - POST", "array with multiple items should warn", "request request body `undefined` body (without body serializer) - DELETE", "params query querySerializer primitives", "CLI snapshot > DigitalOcean", "request request body `0` body (with body serializer) - POST", "createClient options content-type provided default content-type for body-full requests - POST, null", "transformRequestBodyObject requestBodies -> POST data with default values", "client useQuery should resolve data properly and have error as null when queryFn returns null", "createClient options content-type no content-type for body-less requests - DELETE", "createClient options content-type specified content-type for body-full requests - POST, false", "transformSchemaObject > object const > string (inferred)", "raw schema", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - OPTIONS, 1", "types GetResponseContent MixedResponses non existent media type", "3.1 discriminators allOf > mapping", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PUT, 0", "request request body `null` body (with body serializer) - PUT", "client useMutation mutate should resolve data properly and have error as null when successfull request", "createClient options content-type provided default content-type for body-full requests - OPTIONS, 0", "createMutateHook useMutate -> mutate -> key matcher matches when prefix and path are equal and init isn't given", "createClient options content-type implicit default content-type for body-full requests - PUT, false", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PATCH, null", "createClient options content-type no content-type for body-less requests - OPTIONS", "request cookie header is preserved", "request request body `null` body (with body serializer) - POST", "baseUrl can be overridden", "Node.js API options > enum", "composition oneOf > nullable (deprecated syntax)", "Node.js API options > exportType > false", "request headers default headers are preserved", "tsIsPrimitive number", "createClient options content-type provided default content-type for body-full requests - DELETE, false", "openapiTS examples > skipped", "createInfiniteHook passes correct key loader to useSWRInfinite", "transformComponentsObject transform > with transform object", "request request body `null` body (without body serializer) - DELETE", "request request body `0` body (with body serializer) - DELETE", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PUT, {}", "createClient options content-type implicit default content-type for body-full requests - PATCH, null", "createClient options content-type implicit default content-type for body-full requests - DELETE, false", "transformRequestBodyObject empty", "receives a UUID per-request", "createClient options content-type provided default content-type for body-full requests - OPTIONS, null", "createMutateHook useMutate -> mutate -> key matcher returns false for non-array keys", "tsArrayLiteralExpression with setting: export", "isThunk", "request request body `0` body (with body serializer) - PUT", "Node.js API input > URL > local", "transformSchemaObject > object const > number", "simple class", "transformSchemaObject > number nullable (deprecated syntax)", "3.1 discriminators oneOf > explicit mapping > replace discriminator enum", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - DELETE, {}", "request request body `''` body (with body serializer) - PATCH", "transformSchemaObject > array nullable", "request request body `false` body (without body serializer) - PUT", "composition polymorphic > enum + nullable (null missing in enum, falsy value in enum", "openapiTS $refs > parameters get hoisted", "createClient options content-type implicit default content-type for body-full requests - PUT, 1", "composition enum > acting as oneOf", "transformSchemaObject > object options > excludeDeprecated: true", "request request body `null` body (without body serializer) - PUT", "POST multipart/form-data simple", "createClient options content-type no content-type for `undefined` body requests - OPTIONS", "params query querySerializer array pipeDelimited", "request request body `false` body (with body serializer) - PUT", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - DELETE, 0", "transformSchemaObject > boolean basic", "params query querySerializer array form", "request request body `null` body (without body serializer) - POST", "createPathBasedClient path based client GET (no params)", "client useMutation mutateAsync should use provided custom queryClient", "Node.js API options > dedupeEnums", "tsIsPrimitive boolean", "createClient options content-type no content-type for body-less requests - PUT", "transformSchemaObject > object options > additionalProperties: true", "transformSchemaObject > array options > immutable: true (tuple)", "createClient options content-type provided default content-type for body-full requests - PATCH, false", "github", "CLI Redocly config automatic config", "params path escapes reserved characters in path segment", "transformSchemaObject > array tuple > prefixItems", "CLI flags --version", "Invalid schemas OpenAPI < 3 throws", "request request body `''` body (without body serializer) - PUT", "transformPathsObject basic", "request request body `undefined` body (with body serializer) - DELETE", "createClient options content-type implicit default content-type for body-full requests - OPTIONS, 1", "client useInfiniteQuery should use return type from select option", "createClient options content-type provided default content-type for body-full requests - DELETE, 1", "transformSchemaObject > array options > arrayLength: true > maxItems: 20", "transformSchemaObject > boolean enum", "@ApiExcludeController", "params query querySerializer object form", "createClient options content-type specified content-type for body-full requests - DELETE, false", "TRACE() (not supported in Node.js)", "client useQuery handles undefined response with non-zero Content-Length (status 200) by setting error and undefined data", "addJSDocComment multi-line comment", "createClient options content-type implicit default content-type for body-full requests - OPTIONS, 0", "POST request body requestBody (inline)", "transformSchemaObject > object options > propertiesRequiredByDefault: true", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - DELETE, 0", "createClient options content-type provided default content-type for body-full requests - POST, {}", "composition oneOf > primitives", "request request body `undefined` body (with body serializer) - HEAD", "createClient options content-type provided default content-type for body-full requests - PUT, 1", "types GetResponseContent MixedResponses returns 200 & 500 responses", "GET gracefully handles invalid JSON for errors", "transformRequestBodyObject basic", "tsEnum number members with x-enum-descriptions", "stripe", "tsEnum string members with numeric prefix", "createClient options content-type specified content-type for body-full requests - OPTIONS, 0", "transformResponseObject basic", "createMutateHook invokes debug value hook with client prefix", "client useQuery should resolve error properly and have undefined data when failed request", "client queryOptions returns query options that can be passed to useSuspenseQuery", "POST request body requires necessary requestBodies", "createClient options content-type specified content-type for body-full requests - DELETE, 1", "tsEnum x-enum-varnames", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - DELETE, 1", "transformPathsObjectToEnum with and without operationId", "composition anyOf > basic", "request request body missing body (without body serializer) - PUT", "response data/error media union invalid", "Node.js API input > buffer", "request request body `0` body (with body serializer) - PATCH", "client useQuery should use provided custom queryClient", "empty array should warn", "request request body missing body (with body serializer) - OPTIONS", "client useQuery should infer correct data and error type", "can modify response", "createClient options content-type specified content-type for body-full requests - POST, null", "request request body missing body (without body serializer) - POST", "Node.js API options > exportType > true", "request request body `''` body (without body serializer) - OPTIONS", "request request body `false` body (without body serializer) - POST", "@ApiProperty", "composition oneOf > object with properties", "skips subsequent onRequest handlers when response is returned", "response data/error valid path", "createClient options content-type specified content-type for body-full requests - PUT, null", "response parseAs text", "tsUnion one", "configureBaseQueryHook invokes debug value hook with path", "request request body missing body (with body serializer) - PUT", "Node.js API input > object", "createClient options content-type implicit default content-type for body-full requests - PUT, {}", "transformSchemaObject > array options > arrayLength: true > maxItems: 2", "response data/error media union application/json", "request request body `false` body (with body serializer) - DELETE", "response data/error media union application/vnd.api+json", "CLI stdin", "tsPropertyIndex valid strings -> identifiers", "createClient options baseUrl per request causes no override on default baseUrl", "transformOperationObject supports XX codes", "tsUnion multiple (object types)", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PUT, null", "tsArrayLiteralExpression name from path", "createClient options content-type implicit default content-type for body-full requests - PUT, 0", "response parseAs use the selected content", "composition oneOf > polymorphic", "createImmutableHook creates factory function using useSWRImmutable", "createClient options content-type specified content-type for body-full requests - PUT, {}", "request request body `undefined` body (with body serializer) - PATCH", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PUT, {}", "transformPathItemObject options > excludeDeprecated: true", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - OPTIONS, null", "createRef escapes", "createClient options content-type specified content-type for body-full requests - DELETE, null", "transformPathsObjectToEnum basic", "PUT sends the correct method", "requestInitExt", "createClient options baseUrl per request", "openapiTS $refs > path object", "transformWebhooksObject basic", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PATCH, null", "request request body `null` body (with body serializer) - DELETE", "types GetResponseContent MixedResponses returns correct type for 200 with literal", "transformSchemaObject > object const > number (inferred)", "createClient options content-type provided default content-type for body-full requests - DELETE, {}", "response response object 404", "createClient options content-type implicit default content-type for body-full requests - DELETE, {}", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PATCH, 1", "response data/error returns union for mismatched response", "transformSchemaObject > empty/unknown empty object", "transformOperationObject parameters > root not optional if any path params", "transformSchemaObject > object options > two-dimensional array", "response response object 500", "composition discriminator > allOf", "client useQuery should infer correct data when used with select property", "transformSchemaObject > string enum (UTF-8)", "request request body missing body (without body serializer) - GET", "client queryOptions has correct parameter types", "receives OpenAPI options passed in from parent", "client queryOptions returns query options that can be passed to useQueries", "createClient options content-type implicit default content-type for body-full requests - PATCH, {}", "GET sends correct options, returns success", "transformSchemaObject > string nullable (deprecated syntax)", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - OPTIONS, null", "transformSchemaObject > string enum", "transformComponentsObject basic", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PATCH, 1", "createClient options content-type specified content-type for body-full requests - OPTIONS, 1", "types ErrorResponse returns all 5XX and 4xx responses, only application/json", "POST request body requestBody with required: false", "Node.js API input > string > JSON", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - POST, false", "client useQuery passes abort signal to fetch", "tsPropertyIndex numbers -> number literals", "params query querySerializer array form (explode)", "client useMutation mutateAsync should resolve data properly", "params path typechecks", "tsIsPrimitive array", "response response object 200", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - OPTIONS, 0", "request request body `false` body (without body serializer) - PATCH", "transformSchemaObject > object property > boolean", "tsUnion none", "POST sends the correct method", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PUT, false", "client useInfiniteQuery should reverse pages and pageParams when using the select option", "transformPathsObject options > pathParamsAsTypes: true", "transformComponentsObject options > immutable: true", "transformSchemaObject > string enum + nullable + null value", "request request body `''` body (with body serializer) - POST", "client queryOptions returns query options that can resolve data correctly with fetchQuery", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PATCH, 0", "CLI snapshot > GitHub API (root types)", "createMutateHook useMutate -> mutate -> key matcher returns false for arrays with length !== 3", "configureBaseQueryHook passes correct key to useSWR", "request request body `''` body (with body serializer) - OPTIONS", "request sends correct method", "transformSchemaObject > object nullable (deprecated syntax)", "createClient options content-type implicit default content-type for body-full requests - DELETE, 0", "params query querySerializer array params (empty, multiple)", "createInfiniteHook invokes debug value hook with path", "transformSchemaObject > object additionalProperties > basic", "transformSchemaObject > array options > immutable: true", "createQueryHook creates factory function using useSWR", "composition discriminator > automatic propertyName", "createClient options content-type specified content-type for body-full requests - PATCH, 0", "transformSchemaObject > object x-* properties > ignored", "transformSchemaObject > array ref", "request request body `undefined` body (with body serializer) - GET", "composition allOf > sibling required", "primitive", "model", "getEntries operates like Object.entries()", "Node.js API options > pathParamsAsTypes > false", "GET sends correct options, returns error", "createClient options content-type implicit default content-type for body-full requests - PATCH, 1", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - OPTIONS, {}", "constructor", "request request body `undefined` body (without body serializer) - OPTIONS", "createClient options baseUrl removes trailing slash", "request request body `null` body (with body serializer) - OPTIONS", "request request body `false` body (with body serializer) - OPTIONS", "transformSchemaObject > object additionalProperties > empty object", "openapiTS nullable > 3.1 syntax", "params query querySerializer array params (empty)", "@ApiQuery", "createClient options content-type no content-type for `undefined` body requests - HEAD", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PUT, 1", "createClient options content-type specified content-type for body-full requests - PUT, false", "@ApiResponse", "request request body `0` body (without body serializer) - OPTIONS", "client queryOptions returns query options without an init", "createClient options content-type implicit default content-type for body-full requests - POST, {}", "tsArrayLiteralExpression number members", "Node.js API snapshot > Octokit GHES 3.6 Diff to API", "client useSuspenseQuery passes abort signal to fetch", "createClient options content-type specified content-type for body-full requests - DELETE, 0", "CLI snapshot > GitHub API", "CLI snapshot > GitHub API (immutable)", "transformSchemaObject > array boolean items", "tsEnum replace special character", "can be skipped without interrupting request", "createClient options content-type provided default content-type for body-full requests - DELETE, 0", "openapiTS $refs > YAML anchors", "transformSchemaObject > array tuple > tuple items", "transformSchemaObject > number enum", "composition polymorphic > nullable", "request request body `undefined` body (with body serializer) - POST", "transformSchemaObject > empty/unknown false", "Node.js API options > postTransform", "createClient options content-type provided default content-type for body-full requests - OPTIONS, {}", "@ApiParam", "transformSchemaObject > string enum (inferred)", "tsArrayLiteralExpression with setting: readonly", "composition discriminator > oneOf inside object", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PUT, 1", "params query querySerializer empty/null params", "params header per-request", "Node.js API options > transform with blob", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - POST, 1", "request can attach custom properties to request", "client useInfiniteQuery should use custom cursor params", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - DELETE, false", "params query querySerializer ignores leading ? characters", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - DELETE, {}", "PATCH sends the correct method", "can modify errors", "transformSchemaObject > object options > emptyObjectsUnknown: true", "createClient options content-type no content-type for `undefined` body requests - DELETE", "POST multipart/form-data file", "oapiRef `properties` of component schema `properties`", "createClient options content-type provided default content-type for body-full requests - PATCH, {}", "Invalid schemas Unresolved $ref error messages", "YAML features merge", "request request body `undefined` body (without body serializer) - GET", "CLI flags --properties-required-by-default", "CLI snapshot > Octokit GHES 3.6 Diff to API", "Node.js API snapshot > Stripe", "createClient options content-type implicit default content-type for body-full requests - PUT, null", "request request body `false` body (without body serializer) - OPTIONS", "tsPropertyIndex invalid strings -> string literals", "CLI snapshot > GitHub API (types + immutable)", "response parseAs arrayBuffer", "Invalid schemas Swagger 2.0 throws", "request headers supports arrays", "transformSchemaObject > string nullable", "response data/error returns union for mismatched\u00a0errors", "tsEnum x-enum-descriptions with x-enum-varnames", "tsArrayLiteralExpression string members", "Node.js API options > enumValues", "createClient options content-type specified content-type for body-full requests - PATCH, {}", "transformRequestBodyObject no-content", "transformOperationObject defaultNonNullable > parameters aren\u2019t required even with defaults", "transformSchemaObject > array basic", "response parseAs blob", "composition oneOf > nullable", "3.1 discriminators allOf > no mapping", "createClient options content-type provided default content-type for body-full requests - POST, 1", "transformSchemaObject > string default + nullable + enum", "client useQuery should resolve data properly and have error as null when successful request", "createPathBasedClient path based client GET (params)", "can be ejected", "request sends correct method with params", "DELETE returns undefined on Content-Length: 0", "request request body missing body (with body serializer) - GET", "transformHeaderObject basic", "simple schema", "simple array", "GET handles empty-array-type 204 response", "getEntries options excludeDeprecated: true", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - PUT, null", "transformSchemaObject > object const > string", "createClient options content-type no content-type for `undefined` body requests - PUT", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PUT, false", "auth header", "createClient options content-type provided default content-type for body-full requests - PUT, null", "configureBaseQueryHook passes correct fetcher to useSWR", "types SuccessResponse returns all 2XX responses, only application/json", "createClient options content-type no content-type for `undefined` body requests - PATCH", "transformSchemaObject > boolean nullable", "createClient options content-type no content-type for `undefined` body requests - GET", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - OPTIONS, 1", "tsUnion multiple (primitive)", "client useSuspenseQuery should properly propagate error to suspense with a failed http request", "3.1 discriminators oneOf > implicit mapping", "transformComponentsObject options > rootTypes: true and rootTypesNoSchemaPrefix: true", "transformSchemaObject > object JSONSchema > $defs", "createClient options content-type specified content-type for body-full requests, even when default is suppressed - POST, null", "transformSchemaObject > object default", "createClient options content-type provided default content-type for body-full requests - PUT, false", "GET handles array-type responses", "request request body `0` body (with body serializer) - OPTIONS", "createClient options content-type no content-type for body-less requests - PATCH", "createClient options content-type specified content-type for body-full requests - PATCH, null", "transformSchemaObject > array nullable items", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - OPTIONS, 0", "createRef handles partial paths", "composition polymorphic > enum + nullable (null missing in enum)", "client useMutation mutateAsync should throw an error when failed request", "returns original errors if nothing is returned", "request request body missing body (with body serializer) - POST", "createClient options content-type no content-type for body-less requests - HEAD", "transformSchemaObject > object empty", "client useInfiniteQuery should fetch data correctly with pagination and include cursor", "createClient options content-type provided default content-type for body-full requests - PATCH, 0", "request request body `''` body (without body serializer) - PATCH", "request request body missing body (with body serializer) - DELETE", "oapiRef multiple parts", "transformPathItemObject operations", "request headers arbitrary headers are allowed on any request", "createClient options baseUrl", "createClient options content-type no content-type for body-less requests - GET", "transformSchemaObject > string enum + nullable (deprecated syntax)", "configureBaseQueryHook passes correct config to useSWR", "transformSchemaObject > string enum + nullable", "can modify request", "tsEnum partial x-enum-varnames and x-enum-descriptions", "transformSchemaObject > number nullable", "createClient options content-type provided default content-type for body-full requests - PATCH, 1", "request request body `null` body (without body serializer) - PATCH", "createClient options content-type provided default content-type for body-full requests - POST, false", "createClient options content-type implicit default content-type for body-full requests - POST, 0", "@ApiTags", "createMutateHook returns callback that invokes swr `mutate` with fn, data and options", "createClient options content-type implicit default content-type for body-full requests - DELETE, 1", "executes error handlers in expected order", "client useMutation mutate should resolve error properly and have undefined data when failed request", "client queryOptions returns query options that can be passed to useQuery", "transformComponentsObject all optional parameters", "openapiTS inject option", "createInfiniteHook passes correct config to useSWRInfinite", "transformResponseObject no-content", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PATCH, {}", "request headers default headers can be overridden", "client useMutation mutate should resolve data properly and have error as null when mutationFn returns undefined", "composition oneOf > object without properties", "@ApiCookie", "3.1 discriminators oneOf > explicit mapping > append enum in allOf", "createClient options content-type specified content-type for body-full requests - POST, 1", "can catch errors and return a response instead", "openapiTS nullable > 3.0 syntax", "transformSchemaObject > array options > arrayLength: true > minItems: 2, maxItems: 2", "createClient options content-type specified content-type for body-full requests - PUT, 0", "client generates all proper functions", "preserves (and can safely add) headers", "createClient options content-type native-fetch default content-type for body-full requests, when default is suppressed - PATCH, false", "type error occurs only when neither onRequest nor onResponse is specified", "request request body missing body (with body serializer) - HEAD", "@ApiHeader", "request request body missing body (with body serializer) - PATCH", "params query querySerializer allowReserved", "transformSchemaObject > object options > immutable (array)", "params query querySerializer function global default", "transformPathsObjectToEnum with operationId", "sends the correct method", "array", "createClient options content-type implicit default content-type for body-full requests - OPTIONS, null", "request request body `''` body (without body serializer) - DELETE", "transformSchemaObject > object options > propertiesRequiredByDefault: true + array", "transformSchemaObject > number integer", "transformComponentsObject $ref nested properties", "types GetResponseContent picks undefined over never", "client useSuspenseQuery should use provided custom queryClient", "transformSchemaObject > boolean nullable (deprecated syntax)", "openapiTS parameters > operations get correct params"], "test_cmds": ["mkdir -p reports && pnpm exec vitest run --reporter=json 2>&1 | tee reports/vitest-results.json"], "log_parser": "def parser(log: str) -> dict[str, str]:\n import re\n import json\n\n results: dict[str, str] = {}\n\n def norm(status: str) -> str:\n s = status.lower()\n if s in (\"passed\", \"pass\", \"success\"):\n return \"pass\"\n if s in (\"failed\", \"fail\", \"error\", \"xfailed\", \"xpass\"):\n return \"fail\"\n if s in (\"skipped\", \"pending\", \"todo\", \"skip\"):\n return \"skip\"\n return \"fail\" if \"fail\" in s else \"pass\" if \"pass\" in s else \"skip\"\n\n # Extract per-test results from JSON-like lines\n pattern1 = re.compile(\n r'\"fullName\"\\s*:\\s*\"([^\"]+)\"\\s*,\\s*\"status\"\\s*:\\s*\"(passed|failed|skipped|pending|todo)\"',\n re.IGNORECASE,\n )\n pattern2 = re.compile(\n r'\"status\"\\s*:\\s*\"(passed|failed|skipped|pending|todo)\"\\s*,\\s*\"fullName\"\\s*:\\s*\"([^\"]+)\"',\n re.IGNORECASE,\n )\n\n found = False\n for m in pattern1.finditer(log):\n full, status = m.groups()\n results[full] = norm(status)\n found = True\n for m in pattern2.finditer(log):\n status, full = m.groups()\n results[full] = norm(status)\n found = True\n\n if found:\n return results\n\n # Fallback: try to parse the enclosing JSON block if available\n try:\n idx = log.rfind('\"testResults\"')\n if idx != -1:\n start = log.rfind(\"{\", 0, idx)\n if start != -1:\n brace = 0\n end = None\n for i in range(start, len(log)):\n ch = log[i]\n if ch == \"{\":\n brace += 1\n elif ch == \"}\":\n brace -= 1\n if brace == 0:\n end = i + 1\n break\n if end:\n block = log[start:end]\n data = json.loads(block)\n for suite in data.get(\"testResults\", []):\n for ar in suite.get(\"assertionResults\", []):\n name = ar.get(\"fullName\") or ar.get(\"title\")\n status = ar.get(\"status\", \"\")\n if name:\n results[name] = norm(status)\n if results:\n return results\n except Exception:\n pass\n\n # Final fallback: title + status pairs\n pattern_title = re.compile(\n r'\"title\"\\s*:\\s*\"([^\"]+)\"\\s*,\\s*\"status\"\\s*:\\s*\"(passed|failed|skipped|pending|todo)\"',\n re.IGNORECASE,\n )\n for m in pattern_title.finditer(log):\n title, status = m.groups()\n results[title] = norm(status)\n\n return results", "docker_image": "starryzhang/sweb.eval.x86_64.openapi-ts_1776_openapi-typescript-2365", "context_files": null, "result": {"timing": {"setup": 2.3, "pre_test_0": 57.5, "pre_test_1": 34.2, "post_test_0": 39.7, "post_test_1": 33.6, "total": 169.3}, "context_lines": 1498, "buggy_files": [".changeset/itchy-jobs-create.md", "packages/openapi-metadata/src/decorators/api-operation.ts", "packages/openapi-metadata/src/metadata/operation.ts"]}} | |