fix(common): environment variable mapping when referencing other variables (#5704)

This commit is contained in:
Aaron Fort Garcia 2026-01-14 08:42:16 +01:00 committed by GitHub
parent 6c2128fbed
commit 254eb3c958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -63,7 +63,7 @@ const getCollectionSchema = (jsonStr: string): string | null => {
}
}
const replacePMVarTemplating = flow(
export const replacePMVarTemplating = flow(
S.replace(/{{\s*/g, "<<"),
S.replace(/\s*}}/g, ">>")
)

View file

@ -6,6 +6,7 @@ import { z } from "zod"
import { safeParseJSON } from "~/helpers/functional/json"
import { IMPORTER_INVALID_FILE_FORMAT } from "."
import { uniqueID } from "~/helpers/utils/uniqueID"
import { replacePMVarTemplating } from "./postman"
const postmanEnvSchema = z.object({
name: z.string(),
@ -56,8 +57,8 @@ export const postmanEnvImporter = (contents: string[]) => {
name,
variables: values.map(({ key, value, type }) => ({
key,
initialValue: value,
currentValue: value,
initialValue: replacePMVarTemplating(value),
currentValue: replacePMVarTemplating(value),
secret: type === "secret",
})),
})