buildQueryString should not force to use brackets around nested properties

Aperta
#38 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
api

Direzione di ricerca

Inizia dal punto di ingresso buildQueryString in aurelia-path 1.1.5 e verifica come vengono attualmente serializzate le proprietà annidate. Confronta l’output esistente con parentesi quadre con la strategia con punti richiesta, inclusi il modo in cui i chiamanti dovrebbero scegliere tra le strategie e il comportamento previsto per i valori indicizzati. Il lavoro è completato quando il metodo supporta l’opzione di compatibilità richiesta senza modificare il comportamento previsto con parentesi quadre.

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

Descrizione

I'm submitting a feature request

  • Library Version:
    aurelia-path 1.1.5

Please tell us about your environment:

  • Operating System:
    Ubuntu

  • Node Version:
    13.0.1

  • NPM Version:
    6.12.0

  • JSPM OR Webpack AND Version
    webpack 4.41.2

  • Browser:
    all

  • Language:
    all

Current behavior:

buildQueryString with complex object returns a query string where nested properties (example : author.lastname) are surrounded by square brackets. Exemple : author[lastname].

Expected/desired behavior:

For JS server I guess it is equal, since author.lastname and author["lastname"] are the same, but in Java (and probably in .NET), brackets are only use if the property is indexed (a Map or a List if a number is between the brackets).

  • What is the expected behavior?

it would be nice to add a parameter to the buildQueryString method, so the caller can choose a strategy (dot, brackets). dot could even be the default strategy if it makes no difference for JS web servers.

  • What is the motivation / use case for changing the behavior?

better compatibility with non JS web servers.

Lingua principale
TypeScript
Stelle
20
Fork
27
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 aurelia/path

Tutte le issue di aurelia/path

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.