Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

String Interpolation for Update Values

Aperta
#136 15 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #238 di @baywet — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla

Direzione di ricerca

Inizia leggendo l’issue collegata Environment Variables e gli esempi Arazzo referenziati in questa issue, quindi esamina la discussione qui. Determina se l’interpolazione con prefissi e suffissi debba essere supportata insieme alla sintassi proposta $env.VAR_NAME; per considerare il lavoro completato sono necessari un design concordato e modifiche chiare alla specifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
121
Fork
38
Merge medio
1g 17h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OAI/Overlay-Specification

Tutte le issue di OAI/Overlay-Specification

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.