Comments (6)
@tayvs yes, we are working on it. Should be ready in the nearest future, stay tuned :)
from tapir.
@adamw @ghostbuster91 Is there any updates?
from tapir.
@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.
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.
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.
Released in 0.10.0
@luksow your comment moved to #208 :)
from tapir.
Related Issues (20)
- OpenAPI schema for union types is missing the discriminator level. HOT 3
- High latency for netty-loom POST processing HOT 4
- Let serverSecurityLogic access path values HOT 3
- [BUG] Hidden body schema appears in OpenAPI specs
- JSON codec maps None to empty body, keeps content type
- Rename NettyIdServer to NettySyncServer
- Move IntersectionTypeMirror & UnionTypeMirror to the iron integration
- Validation of endpoints against a given OpenAPI schema HOT 4
- [BUG] CORSInterceptor doesn't work with Vert.x server
- [BUG] Tapir Endpoint Incorrectly Merging Set-Cookie Headers in HTTP Response HOT 3
- [BUG] .corsInterceptor throws overloaded method with alternatives error HOT 4
- Schema of `oneOf` variants with same status code and content-type HOT 5
- Web Sockets for netty-server-loom
- [BUG] WebSocket routes always trigger error when using as part of an existing Play Application HOT 1
- tapir server to ignore any validations HOT 9
- [BUG] Websockets with zio-http can fail on too early messages on slow hosts
- [BUG] ClosedChannelException when consuming stream response body with Fs2Streams HOT 1
- Issue with Recognition of API path in Tapir version 10.4.1 HOT 5
- Relaxed enumeratum codecs HOT 2
- [BUG] Can no longer return 304 with empty string as body - get 500 internal server error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tapir.