Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • May 25 07:32
    scala-steward opened #687
  • May 24 19:41
    scala-steward closed #680
  • May 24 19:41
    scala-steward commented #680
  • May 24 19:41
    scala-steward opened #686
  • May 20 07:37
    scala-steward opened #685
  • May 13 22:40
    scala-steward closed #683
  • May 13 22:40
    scala-steward commented #683
  • May 13 22:40
    scala-steward opened #684
  • Apr 27 11:50
    hughlunt commented #492
  • Apr 21 08:50
    scala-steward closed #681
  • Apr 21 08:50
    scala-steward commented #681
  • Apr 21 08:50
    scala-steward opened #683
  • Apr 07 14:52
    scala-steward opened #682
  • Apr 07 03:14
    scala-steward closed #677
  • Apr 07 03:14
    scala-steward commented #677
  • Apr 07 03:14
    scala-steward opened #681
  • Apr 05 02:46
    scala-steward closed #675
  • Apr 05 02:46
    scala-steward commented #675
  • Apr 05 02:46
    scala-steward opened #680
  • Apr 04 16:35
    scala-steward closed #660
Eric Meisel
Hello there. Quick question. Are pathVars not supported like query params in terms of Enums? See above. Both use a StringParser based on an Enumeratum enum, but the path param comes through odd
this is on 0.19.1
implicit def producerTypeStringParser[F[_]]: StringParser[F, ProducerType] =
    new StringParser[F, ProducerType] {
      override def parse(
          s: String
        )(implicit F: Monad[F]
        ): ResultResponse[F, ProducerType] =
        try SuccessResponse(ProducerType.withName(s))
        catch {
          case _: NoSuchElementException =>
            FailureResponse.pure[F] {
              BadRequest.pure(s"Invalid ProducerType format: '$s'")
      override val typeTag: Option[TypeTag[ProducerType]] = Some(
This is my StringParser FWIW
Kaspar Fischer
Hey folks, I'm doing val myIdsList = paramD[List[Long]]("myIds", "Some ids") which works as expected: it parses ?myIds=1&myIds=2 to a List[Long]. However, how can I use my own StringParser[IO, List[Long]] instead of QueryParsers.multipleParse? I'd like to manually parse ?myIds=1,2 to List[Long].
Kaspar Fischer

The above came up during an upgrade from v0.19.0 to v0.20.0 where I noticed that suddenly, our custom StringParser[IO, List[Long]] wasn't picked up and instead, QueryParsers.multipleParse was being used.

What I see is that v0.19.0's multiParse() is defined for Seq[_] while v0.20.0's multiParse() is defined for generic B[_].

I also see that QueryParsers.standardCollector and QueryParsers.multiParse are defined in the same scope. Would it help here if standardCollector had higher priority than multiParse()?

Kaspar Fischer
Just in case it helps anyone running into a similar problem. I managed to override the default multiParse by defining the following:
  implicit def http4sMultipleParseOverride[A](
    implicit F: Monad[IO],
    p: StringParser[IO, List[A]],
    cbf: Factory[A, List[A]]
  ): QueryParser[IO, List[A]] =
    standardCollector[List[A]](F, p)
Igor Cândido
Is there a way to add example/examples to response models without having to manually defining the response model through withSerializers?
Darren Gibson
Not at this time, but it would be a useful feature. Feel free to add a Issue or PR !
Anton Solovyev
Hi all! Is there a way to get field names in snake_case in openapi?
Hi All, does anyone have examples of the use of genericHeaderCapture to capture generic headers of the form x-custom-header for a Rho route?
Ben List
Does the latest version of Rho work with the v1.0.0-M3 release of http4s?
Gavin Bisesi
:wave: What's the plan for the future of the DSL given that symbol literals are deprecated?
Rafał Sumisławski
Hi @Daenyth
As an alternative to 'foo we've introduced pv"foo". pv stands for pathVar.
You can see an example here https://github.com/http4s/rho/blob/master/examples/src/main/scala/com/http4s/rho/swagger/demo/MyRoutes.scala#L45
Gavin Bisesi
Yotam Hochman
Hi, I started to use rho and see that when I create a RhoRoutes, I get a logger from it
is there any convenient way to use a different logger (scalalogging's one) but still using the variable name logger ?
Rafał Sumisławski

Hi @Yotamho
You cloud copy the source of RhoRoutes, and have your own version with the logger field removed. That's what I would do.

Among other options you can also create a block { } inside your class extending RhoRoutes. And while you cannot create a 'logger' field in the class, you can create a val logger in the block, which will shadow the logger field inherited from RhoRoutes. You would then have to put all your code using the logger inside that block. That would work as long as you don't plan having any public members in that class (you can't put public members in the block). It's a bit hacky :P

Kingsley Hendrickse
hi - for a List[Long] as the payload in a POST request - it's generating this yaml - which looks incorrect - any ideas on how to solve this?
 - in: "body"
        name: "body"
        description: "List«Long»"
        required: true
          type: "array"
            title: "Long"
            $ref: "#/definitions/Long"
Gavin Bisesi
that A+circumflex looks like mojibake
are you sure you're generating utf-8 yaml and viewing the file as utf-8
I think that specific character indicates your yaml file might actually be Latin-1 instead of utf-8
If not that, then the inverse
Or CP1252, which is almost the same as Latin-1
Kingsley Hendrickse
the items part seems wrong tho
in the doc it makes a list of empty object
I would have thought it should make items with: type: 'Integer', no ref as it's a primitive and then format: 'int64'
like this
  type: "array"
            type: "integer"
            format: "int64"
Gavin Bisesi
Oh it's probably because List is a generic and therefore at runtime they get boxed
generics must take subtypes of Object (AnyRef), which primitives are not
Kingsley Hendrickse
I see
Gavin Bisesi
This does feel like something the library should figure out
Kingsley Hendrickse
In my case it's quite common to have lists of int or long or string in the payload of POST and PUT requests
Gavin Bisesi
I think it does get specialized, maybe? I'd open a ticket
Kingsley Hendrickse
many of the endpoints were designed way before I started looking at Rho and how to auto generate the docs
yeah - I'm not sure how frequently things get picked up here - maybe I should take a look and send a pull request
thanks for your help :)
Yasuhide Hoshiko
Hi, is there a way to add descriptions to request body or headers? I can't find any documentation nor examples..
Kingsley Hendrickse
@Daenyth do you know if it's possible to write the generated yaml / json to a file as well as serving it? Currently the served yaml inherits the authorisation so can't be accessed unless authorised but we want to maybe write it to file and serve it from a non authed endpoint.
Hey all, quick (and potentially naive) question about using the API. After some digging as to why my swagger docs didn't cover any of the response types, I discovered that if I moved the response code (e.g. Ok(...)) into the body of new RhoRoutes[IO] { ... } then everything started working. So my next question is, how can we achieve this without requiring that everything be written in situ?
At the moment, my best guess is to pass new argument around everywhere (implicit responses: ResponseGeneratorInstances[IO]) and try and use this when declaring the routes? ... E.g. "Description of an endpoint" ** POST / "pathhere" ^ jsonOf[IO,MyType] |>> { (body: MyType) => myDef(body)(this) }
I feel like this can't possibly be the right way to go about it though
Kingsley Hendrickse
Ive just started using rho and i found that due to the way it works with implicits i have to put everyhing inside the new RhoRoutes - the only way i found as a workaround was to pass the rho routes into another class and import e.g. import rhoRoutes._ to get all the implicits
Hi all! I have POST endpoint with case classes for request and response. All fields in case classes in camelCase but circe configured to use snake_case. Rho generates definitions in camelCase. How to generate swagger.json with definitions in snake_case?
Hi. I have an API using authorization on some end points. I'm trying to integrate rho for swagger generation. Above I found a message that confirmed that for generating swagger spec, there is some plumbing required for APIs with authorization (cannot use SwaggerMiddleware). But I have even more problems (at least I think so, because I do not fully grasp everything). My authorized routes are nested within Routers. I'm under the impression that the authorization rho meta information does not compose through Routers. At least this is not implemented. Can someone please comment on my thoughts? I can also provide some more details, if required.
Alexandr Solodkyi
@jjcapper I solved it with next hack:
object Api extends ResponseGeneratorInstances[IO]
usage outside RhoRoutes:
Adriani Furtado
Hi All, could anyone point me in the right direction as to how I can specify the swagger format for a query param. I currently have a query parameter that I would like to be displayed as a UUID. I tried to have a look at the lib code but couldn't find any references to format