Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

String Interpolation for Update Values

Đang mở
#136 15 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #238 của @baywet — đã đóng, không merge

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách đọc issue Environment Variables được liên kết và các ví dụ Arazzo được tham chiếu trong issue này, sau đó xem lại phần thảo luận ở đây. Xác định liệu có nên hỗ trợ phép nội suy với tiền tố và hậu tố cùng với cú pháp $env.VAR_NAME được đề xuất hay không; để được xem là hoàn tất, cần có một thiết kế đã được thống nhất và các thay đổi đặc tả rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
122
Fork
38
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OAI/Overlay-Specification

Tất cả issue của OAI/Overlay-Specification

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.