kean / Get

Web API client built using async/await
MIT License
943 stars 75 forks source link

[Question] Purpose of `Request`'s `id` property? #33

Closed liamnichols closed 2 years ago

liamnichols commented 2 years ago

👋 I noticed that Request defines the following property:

https://github.com/kean/Get/blob/f93c8efb3cc17b4e6404bd943949b631b1836a12/Sources/Get/Request.swift#L17

But it's not currently used. I'm wondering what the intended purpose of this property was?

For context, for crash reporting/debugging purposes, I want a way to identify which path (endpoint/controller) is being represented by a Request when using CreateAPI to generate those request definitions. Using the actual URL path doesn't cut it, because /repos/1 and /repos/2 are not unique when they are both representing the same endpoint (/repos/{id}).

For that reason, I had considered that maybe CreateAPI could pass the operationId to this property, but I didn't want to open a PR that could make that possible if I misunderstood the purpose of it.

WDYT? Thanks!

kean commented 2 years ago

Hi,

That's exactly what it a was added for – operation IDs.

There is an existing isAddingOperationIds option in CreateAPI that does it.

liamnichols commented 2 years ago

Ha whoops, I totally missed that! Thanks 🚀