Type declarations are not case consistent

Aperta
#736 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
api

Direzione di ricerca

Start from the payment.d.ts declaration the issue names and compare its property casing with the Payments and Budgets responses the issue quotes. The issue does not say whether the SDK types are generated, so first check how the declarations are produced before editing any of them. Done would mean the declared property names match the API's capitalised responses, which needs a maintainer decision on the generation approach.

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

Descrizione

SDK you're using (please complete the following information):

  • Version 9.3.0-alpha.5

Describe the bug
The exported types from the xero-node sdk are not capitalised yet the responses from the API are.

This mismatch makes it so that the types can't be used to define response payloads without some kind of manual serialisation step involved, or opting to simply not use them at all.

e.g. GET Payments
API returns BankAmount, Amount etc
The SDK type declaration has these as bankAmount, amount

To Reproduce
Steps to reproduce the behavior:

  1. Go to API Explorer and call any basic GET endpoint (Payments)
  2. Observe response with capitalised property names
  3. Find payment.d.ts file in xero-node SDK
  4. See the same type but with lowercase starting property names

Expected behavior
The types in the SDK should match the API responses.

Screenshots
image
image

I have observed this so far with Payments and Budgets, however I imagine this is the same for most/all endpoints.

Lingua principale
TypeScript
Stelle
264
Fork
177
Merge medio
10h 5m
PR unite (30g)
5

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 XeroAPI/xero-node

Tutte le issue di XeroAPI/xero-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.