softwaremill / tapir

Rapid development of self-documenting APIs
https://tapir.softwaremill.com
Apache License 2.0
1.35k stars 411 forks source link

Add docs about array path params #3877

Open kciesielski opened 3 months ago

kciesielski commented 3 months ago

Initial issue: We'd like to allow path params like .path[List[T]]("paramName") (https://swagger.io/docs/specification/serialization/) Related discussion on community forum: https://softwaremill.community/t/path-parameter-style-support/411 I don't think there's proper support for this in Tapir nor an issue already registered for this feature.

Update: Turns out it's feasible with Delimited, so this issue becomes a task to add documentation.

kciesielski commented 3 months ago

Turns out this can be nicely handled with Delimited, as Thijs nicely noticed in the forum thread:

given Codec[String, Name, TextPlain] = Codec.parsedString(Name.unsafeApply)
  .validate(Name.given_Schema_Name.validator)
given Codec[String, Delimited[",", Name], TextPlain] = Codec.delimited

Let's update the documentation or examples then.