duffelhq / duffel-api-javascript

JavaScript client library for the Duffel API

Home Page:https://duffel.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should `OfferRequestSlice` `origin` and `destination` be type `Place`?

nathanlindsay opened this issue · comments

Me again... Really sorry!

interface OfferRequestSlice {
    ...
    /**
     * The city or airport the passengers want to travel to
     */
    destination: Place | string;
    /**
     * The city or airport the passengers want to depart from
     */
    origin: Place | string;
   ....
}

Should these just be set to Place? Is there an example of a time when these might be a string?

Hey – I'm not 100% on this, I think there may be use cases where it's appropriate to use a string, so it may be best to leave it as is.

commented

Hey @nathanlindsay! I'll be closing this for now since there hasn't been any activity, but please feel free to re-open if you have any other question. To clarify, we do seem to reuse the OfferRequestSlice type on the CreateOfferRequest type. CreateOfferRequest is used for the payload, where your input and destination are strings with the iata code.That's why we have origin and destination as either Place or string