question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client API feels inconsistent

See original GitHub issue

There are four expect methods:

def expect[A](s: String)(implicit d: EntityDecoder[F, A]): F[A]
def expect[A](uri: Uri)(implicit d: EntityDecoder[F, A]): F[A]
def expect[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[A]
def expect[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[A]
  1. The first two work like special cases where the request is a GET. At the same time, there are two methods called get with the exact same parameters as the first two expects. The same is happening for the expectOr methods.

  2. There is the method:

    def expectOption[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[Option[A]]
    

    But there isn’t the corresponding one for F[Request[F]]:

    def expectOption[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[Option[A]]
    
  3. Tha API has a dedicated DSL for GET requests but not for other commonly used methods: DELETE, PUT, POST, HEAD.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

7reactions
ChristopherDavenportcommented, Apr 6, 2019

Remove/Deprecate all overloads.

2reactions
kevinmeredithcommented, Apr 25, 2019

Would it be worthwhile to deprecate/remove def expect[A](s: String)(implicit d: EntityDecoder[F, A]): F[A], i.e. require a valid Uri to be passed rather than a String?

Uri > String motivates this question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why ALL APIs are inconsistent? : r/rails - Reddit
Idempotent APIs are a solution. If I'm sending a PUT/PATCH with the same body my first request might mutate data on the server...
Read more >
Very strange/inconsistent behaviour when making a GET ...
I am busy with a angular4 web app that uses the youtubeInMp3 API. Everything works as it should when downloading mp3 files using...
Read more >
How AWS dumps the mental burden of inconsistent APIs on ...
AWS APIs are inconsistent among different services, between related services, or within a single service - that's a problem for developers.
Read more >
I am getting inconsistent response times when using REST ...
I have an external client that uses REST API to get responses from the BPM server. The response times are inconsistent. Sometimes the...
Read more >
Genesys API Inconsistent responses
When I am trying to hit Genesys API's in AWS, I see some inconsistency in response. It seems I need to hit 4-5...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found