Giter VIP home page Giter VIP logo

Comments (6)

ghostbuster91 avatar ghostbuster91 commented on May 18, 2024 1

@tayvs yes, we are working on it. Should be ready in the nearest future, stay tuned :)

from tapir.

tayvs avatar tayvs commented on May 18, 2024

@adamw @ghostbuster91 Is there any updates?

from tapir.

danxmoran avatar danxmoran commented on May 18, 2024

@ghostbuster91 sorry for repeated pings, but are there new updates on this? This feature would be a big convenience for my team, so I'd be happy to help out with finishing it if there are pieces that could be split out.

from tapir.

ghostbuster91 avatar ghostbuster91 commented on May 18, 2024

No problem, I also think that this feature will be very convenient for everyone and would love to ship it. Luckily, recently I made almost complete implementation. It is still not merge-able since I was mostly experimenting and doing some shortcuts but I believe that it is something on which we can iterate. It would be great if you can take a look at #201 and give some feedback :)

from tapir.

luksow avatar luksow commented on May 18, 2024

As discussed here: https://gitter.im/softwaremill/tapir?at=5d5fb1d768406739f96b3712 I'm adding my use case. I'd like, on errors, to return the same jsonBody[JsonError] for various errors but different status codes to be a good HTTP/REST citizen. Ex:

    endpoint
      .post
      .in("auth" / "session")
      .in(jsonBody[LoginRequest])
      .out(oneOf(statusMapping(Created, jsonBody[LoginResponse.LoggedIn])))
      .errorOut(...)
      .serverLogic { request =>
        authService.login(request).map {
          case logged @ LoginResponse.LoggedIn(_, _) => Right(logged)
          case LoginResponse.InvalidCredentials => Left((Unauthorized, JsonError("Invalid credentials"))) // just an idea
          case LoginResponse.UserNotFound => Left((NotFound, JsonError("User not found"))) // just an idea
        }
      }

from tapir.

adamw avatar adamw commented on May 18, 2024

Released in 0.10.0
@luksow your comment moved to #208 :)

from tapir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.