Comments (3)
I feared that too many of these combinators might be confusing :) But first, some motivation on why there are two ways to group parameters in the first place. I want to support two scenarios:
-
creating a description of (possibly multiple) input (output) parameters which can be re-used in many endpoint descriptions. For example, quite often you have paging & limit parameters grouped in listing APIs. You can represent this as:
val paging = query[String]("start") and query[Int]("limit")
and use it in many endpoints -
creating re-useable endpoint descriptions, which can be specialized. For example, in your API all endpoints might have a path which starts with
/api
and upon error, return aErrorInfo
JSON. You can represent this as:val baseEndpoint = endpoint.in("api").errorOut(jsonBody[ErrorInfo])
and use it as a base endpoint for all other endpoints.
Given the tradeoff between less ways to group parameters and supporting the two use-cases above, I pick the second option.
However, we might still simplify the usages of and
, /
and &
. Maybe it would make sense to drop &
, and define /
only for paths, that is on PathCapture
and PathSegment
, not on all EndpointIO
s?
from tapir.
In the end keeping and
and /
as ways to combine inputs is as much as I could get - essentially dropping &
. Any other suggestions welcome :)
from tapir.
Closing as "won't fix" for the reasons above. Feel free to reopen if you've got new ideas :)
from tapir.
Related Issues (20)
- Add a flag into `TSchemaToASchema` to distinguish between `mappings` or `consts` for discriminators. HOT 4
- Can we add `SchemaType.Intersection` for `SProduct`s? HOT 1
- Allow for third-party routing logic to tap into the Tapir backends HOT 3
- [BUG] Security path inputs always goes before regular input segments HOT 3
- [BUG] Netty servers shouldn't reply to WS Close frame immediately
- io.netty.handler.timeout.ReadTimeoutException logged for a simple endpoint HOT 13
- Auto-derive default values HOT 1
- [BUG] NoContent with emptyOutput generates string body example HOT 3
- Can we provide better error messages for jsoniter? HOT 3
- confusing validation message when validating all query params HOT 2
- Can we provide some integration which would make it easier to work with htmx projects?
- Can we support custom error message for Enumeration Validation? HOT 3
- [BUG] In documentation collection refined as NonEmpty does not appear as required HOT 1
- [BUG] Not[Empty] iron constraint on collection generates a "Could not find Schema for type io.github.iltotore.iron.IronType" compile error
- [BUG] Enhance iron library support in Tapir HOT 1
- [BUG] Incorrect Either schema names for HKT params
- [BUG] Incorrect schema name for aliased HKT param for map schema HOT 4
- [BUG] incorrect names for newtyped map schemas HOT 2
- Partial<> from javascript analog HOT 5
- [BUG] `zio-http` aspect gets run for each Tapir app, instead of only once HOT 15
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.