Skip to content

Commit

Permalink
fix: imported queryParams bug
Browse files Browse the repository at this point in the history
  • Loading branch information
omermecitoglu committed Dec 12, 2024
1 parent 8b90324 commit 9e2dce9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/injectSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default function injectSchemas(code: string, refName: string) {

const preservedCodeWithSchemasInjected = preservedCode
.replace(new RegExp(`\\b${refName}\\.`, "g"), `global.schemas[${refName}].`)
.replace(new RegExp(`\\b${refName}\\b`, "g"), `"${refName}"`);
.replace(new RegExp(`\\b${refName}\\b`, "g"), `"${refName}"`)
.replace(new RegExp(`queryParams:\\s*['"\`]${refName}['"\`]`, "g"), `queryParams: global.schemas["${refName}"]`);

return restoreStrings(preservedCodeWithSchemasInjected, replacements);
}

0 comments on commit 9e2dce9

Please sign in to comment.