Skip to content

Commit

Permalink
Merge pull request #44 from avast/ArgumentsPureconfigFix
Browse files Browse the repository at this point in the history
Fix: declare/bind arguments are not strict about keys
  • Loading branch information
jendakol authored Feb 12, 2020
2 parents 0f3d0c2 + ec1eac5 commit 54efe29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ myConfig {

declareQueue {
name = "QUEUE2"

arguments = { "x-max-length" : 10000 }
}

bindQueue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class PureconfigImplicits(implicit namingConvention: NamingConvention = CamelCas
private implicit def hint[T]: ProductHint[T] =
ProductHint[T](ConfigFieldMapping(CamelCase, namingConvention), allowUnknownKeys = allowUnknownKeys)

private implicit val declareArgumentsHint: ProductHint[DeclareArgumentsConfig] =
ProductHint[DeclareArgumentsConfig](ConfigFieldMapping(CamelCase, namingConvention), allowUnknownKeys = true)

private implicit val bindArgumentsHint: ProductHint[BindArgumentsConfig] =
ProductHint[BindArgumentsConfig](ConfigFieldMapping(CamelCase, namingConvention), allowUnknownKeys = true)

// connection, producer, consumers:
implicit val connectionConfigReader: ConfigReader[RabbitMQConnectionConfig] = {
if (!allowUnknownKeys) StrictConnectionConfigReader else deriveReader[RabbitMQConnectionConfig]
Expand Down

0 comments on commit 54efe29

Please sign in to comment.