Skip to content

Expose ConfigValue parser #92

@neko-kai

Description

@neko-kai

It's extremely inconvenient to wrap a ConfigValue into a Config just to be able to pass it to the API:

cv =>
  val dec = derivationDerivedDecoder.value
  val (wrappedValue, path) = cv match {
    case configObject: ConfigObject =>
      configObject.toConfig -> None
    case _ =>
      ConfigValueFactory.fromMap(Map("_root_" -> cv).asJava).toConfig -> Some("_root_")
  }
  path.fold(parser.decode[T](wrappedValue)) {
    parser.decodePath[T](wrappedValue, _)
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions