Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

String Interpolation for Update Values

未关闭
#136 15 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #238 来自 @baywet —— 已关闭,未合并

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清

调研方向

先阅读链接的 Environment Variables issue 以及该 issue 中引用的 Arazzo 示例,然后查看这里的讨论。确定除了提议的 $env.VAR_NAME 语法之外,是否还应支持带前缀和后缀的插值;完成这项工作需要达成一致的设计和明确的规范变更。

由索引模型根据 Issue 内容生成。

描述

Was on call with @lornajane today and we discussed Environment Variables and the topic of string interpolation came up.

Lorna proposed using a $env.VAR_NAME syntax, and while we were looking around for prior art we found what appears to be an example of string interpolation in the Arazzo examples which I will copy here, specifically "couponCode": "{$inputs.coupon_code}",:

Example from Arazzo:

  contentType: application/json
  payload: |
    {
      "petOrder": {
        "petId": "{$inputs.pet_id}",
        "couponCode": "{$inputs.coupon_code}",
        "quantity": "{$inputs.quantity}",
        "status": "placed",
        "complete": false
      }
    }

The above example does not have any suffix or prefix literals, but I can imagine that if could:

Example modified to show suffixes and prefixes:

  contentType: application/json
  payload: |
    {
      "petOrder": {
        "petId": "{$inputs.pet_id}000",
        "couponCode": "coupon-{$inputs.coupon_code}",
        "quantity": "{$inputs.quantity}",
        "status": "placed",
        "complete": false
      }
    }

We both agreed there was value to incorporating string interpolation although Lorna argued against doing it sooner than later (I will let her elaborate as to why.)

I argued if we were to adopt Arazzo's style of variables (which I support) — e.g. $env.VAR_NAME — then also supporting string interpolation would be very small incremental lift for implementors with an outsized increase in utility to support more of the 80 percentile of use-cases.

This of course assumes we do not envision that supporting it would block some future capability we plan for in the future.

Lorna asked me to create an issue so that others could weigh in on the idea, and here it is.

主要语言
JavaScript
星标
123
派生
38
平均合并
3 天 22 小时
30 天内合并 PR
11

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OAI/Overlay-Specification 的其他 Issue

查看 OAI/Overlay-Specification 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。