Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 17 2021 22:52
    edma2 added as member
  • Sep 17 2021 22:52
    edma2 removed as member
  • Sep 17 2021 22:51
    edma2 added as member
  • Sep 17 2021 22:51
    edma2 removed as member
  • Jun 13 2020 03:21

    finaglehelper on develop

    finatra: Support for injecting … (compare)

  • Jun 12 2020 22:21

    finaglehelper on develop

    finatra-thrift: Reduce complexi… (compare)

  • Jun 12 2020 02:44

    finaglehelper on develop

    finatra-thrift: Use correct dat… (compare)

  • Jun 11 2020 07:32

    finaglehelper on develop

    finatra-thrift: CommonThriftLog… (compare)

  • Jun 10 2020 19:31

    finaglehelper on develop

    finagle, finatra, ts: Keep `inc… (compare)

  • Jun 10 2020 19:05
    ihasfrozen commented #522
  • Jun 09 2020 00:46

    finaglehelper on develop

    finatra: Add comments for optim… (compare)

  • Jun 08 2020 18:23

    finaglehelper on develop

    finatra-doc: Add missing import… (compare)

  • Jun 05 2020 03:18

    finaglehelper on develop

    inject-core: Remove finagle-cor… (compare)

  • Jun 04 2020 22:33

    finaglehelper on develop

    finatra: Use permanent links fo… (compare)

  • May 29 2020 21:31
    cacoco closed #511
  • May 29 2020 21:31
    cacoco commented #511
  • May 29 2020 21:31
    cacoco closed #524
  • May 29 2020 21:31
    cacoco commented #524
  • May 28 2020 22:31

    finaglehelper on develop

    util|scrooge|finagle|twitter-se… (compare)

  • May 28 2020 00:41

    finaglehelper on develop

    finatra: Update testing docs P… (compare)

Ultimately it's just code, you call logic in other classes how you see fit.
sherzod
@sherzodv
Hi guys, is there a centralized way to change (add) base path to all registered controller in finatra?
4 replies
Christopher Coco
@cacoco
In a controller itself you just use prefix
Eg in MyController you’d scope the routes under prefix(“/api”)
But if you wanted something to apply for all controllers you add to the router...that is not there
Andy
@andy1xx8
@cacoco thanks Christopher. I got it
Marwan Rabbâa
@waghanza
Christopher Coco
@cacoco
@waghanza fixed here: twitter/finatra@660dcb0. Thanks!
Jason Cohen
@jdcohen220
Where can I find the jars for inject-server / EmbeddedTwitterServer for scala 2.12? I am attempting to set up feature tests for HttpServer
Jason Cohen
@jdcohen220
@enbnt thank you!
Jason Cohen
@jdcohen220
Is it possible to conditionally or lazily instantiate/inject modules? Let's say I want my server to either use a MongoDB or Postgres module for the datastore depending on some configuration or flag. I cannot simply inject both since one would fail to start if the instance doesn't exist in that environment.
9 replies
Jason Cohen
@jdcohen220
Any recommendations for in-memory caching libraries that play well with twitter futures?
Christopher Coco
@cacoco
Have you seen Twitter/util/util-cache? https://github.com/twitter/util/tree/develop/util-cache
Vladimir Ivanovskiy
@vi-p4f
Hi! Are there any known obstacles for using Finatra 21.2.0 in Scala 3 built projects?
3 replies
jyanJing
@jyanJing
freshly baked Finatra summer update 😃 : https://finagle.github.io/blog/2021/08/03/summer-review/
jyanJing
@jyanJing
Moses Nakamura
@mosesn
hey folks, I’m starting the process for the 22.2.0 release today!
Bo Zhao
@BoZhaoUT
Hey all, I'm new to Finatra. Could you help me finding a minimalist Finatra boilerplate repo? The example one is deeply nested in the Finatra repo and I don't know how to write a sbt file for it. https://github.com/twitter/finatra/tree/develop/examples/http-server
1 reply
Zach Michaelov
@zmichaelov

Hi all,

According to the docs, the integrated ScalaValidator should check constraints on fields marked optional.
However, when I try to deserialize and validate using the ScalaObjectMapper, I get an error:

No validator could be found for constraint 'interface jakarta.validation.constraints.Min' validating type 'scala.Option'. Check configuration for 'Car.towing_capacity'
jakarta.validation.UnexpectedTypeException: No validator could be found for constraint 'interface jakarta.validation.constraints.Min' validating type 'scala.Option'. Check configuration for 'Car.towing_capacity'
    at com.twitter.util.validation.ScalaValidator.isValid(ScalaValidator.scala:1333)
    at com.twitter.util.validation.ScalaValidator.isValidOption(ScalaValidator.scala:1373)
    at com.twitter.util.validation.ScalaValidator.isValid(ScalaValidator.scala:1295)
    at com.twitter.util.validation.ScalaValidator.isValid(ScalaValidator.scala:1276)
    at com.twitter.util.validation.ScalaValidator.validateField(ScalaValidator.scala:1007)
    at com.twitter.util.validation.ScalaValidator.validateExecutableParameters(ScalaValidator.scala:899)
    at com.twitter.util.validation.ScalaValidator.validateExecutableParameters(ScalaValidator.scala:694)
    at com.twitter.util.jackson.caseclass.CaseClassDeserializer$.executeFieldValidations(CaseClassDeserializer.scala:92)

If I call the Scala Validator directly, it works. Is this a known bug or do I have something misconfigured? I'm on Finatra 21.11.0

Example code to reproduce

import com.twitter.util.jackson.ScalaObjectMapper
import com.twitter.util.validation.ScalaValidator
import jakarta.validation.constraints.Min
import org.scalatest.funsuite.AnyFunSuite

case class Car(@Min(1000) towingCapacity: Option[Int] = None)

class ValidationTest extends AnyFunSuite {

  private val mapper = ScalaObjectMapper.builder.objectMapper
  private val validator = ScalaValidator()

  test("check constraints") {
    // This works
    val car = Car(Some(100))
    validator.validate(car)

    // This throws an error
    val json = """{ "towing_capacity": 100 }"""
    val result = mapper.parse[Car](json)
  }
}
Mike Cripps
@macripps
did you ever work this out, @zmichaelov ?
Mike Cripps
@macripps
Looks like it might have been addressed by twitter/util@3b94d2e
1 reply
Zhenhao Li
@Zhen-hao
hi all, I notice that questions here are rarely answered.
If your question is for work and your company has a budget for paid consulting, I invite you to create a pairing request on https://pairtime.com. If I can't help myself, I will do my best to find the right people to help you.
Khal!l
@redkhalil
Newbie question: How do I use a configuration (from application.conf) in HttpServer subclass? I'm able to inject configuration elsewhere, but not really sure about the HttpServer.
Mike Cripps
@macripps
soz
@iamsoz:matrix.org
[m]
hi