diff --git a/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/__test__/__snapshots__/add-inline-requests.test.ts.snap b/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/__test__/__snapshots__/add-inline-requests.test.ts.snap index 1621d1650dc..85f9f2de46c 100644 --- a/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/__test__/__snapshots__/add-inline-requests.test.ts.snap +++ b/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/__test__/__snapshots__/add-inline-requests.test.ts.snap @@ -78,7 +78,6 @@ exports[`add-inline-requests simple 1`] = ` body: properties: foo: string - docs: i'm a request types: StringAlias: string diff --git a/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/migration.ts b/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/migration.ts index 4af3158a1c7..0df53b77084 100644 --- a/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/migration.ts +++ b/packages/cli/yaml/yaml-migrations/src/migrations/0.1.3-rc3/add-inline-requests/migration.ts @@ -93,13 +93,15 @@ function convertEndpoint({ document, endpoint }: { document: YAML.Document.Parse const objectExtends = maybeTypeDeclarationForRequest.get("extends"); const objectProperties = maybeTypeDeclarationForRequest.get("properties"); if (objectExtends != null || objectProperties != null) { - newRequest.set("name", requestBodyType); - // it's an object, so move to be the request body newBody = maybeTypeDeclarationForRequest; - // prefer request docs to type declaration's docs - newBody.set("docs", originalRequestDocs ?? maybeTypeDeclarationForRequest.get("docs")); + // inline requests can't have docs + newBody.delete("docs"); + + // set request wrapper name to be the old name + newRequest.set("name", requestBodyType); + // remove the old request body type documentTypes.delete(requestBodyType); } }