pureconfig icon indicating copy to clipboard operation
pureconfig copied to clipboard

Support getting List[PathSegment] from ConfigCursor

Open nigredo-tori opened this issue 6 years ago • 1 comments

Ideally I want to be able to get path from ConfigCursor, and plug it directly into a FluentConfigCursor.at(List[PathSegment]).

The most straightforward way I see to implement this would be to switch from List[String] to List[PathSegment] in *Config*Cursor case classes, but that would obviously be breaking. A less invasive change would be to add a method similar to FluentConfigCursor.at, that would accept a List[String] instead of List[PathSegment], and properly deal with arrays/objects.

nigredo-tori avatar Jun 18 '19 10:06 nigredo-tori

I agree that switching from List[String] to List[PathSegment] is the way to go, there are obvious advantages in being able to retrieve a strongly typed path instead of having to parse each segment (and of course, our current way of holding those is ambiguous).

I'll work on doing this change without breaking changes (if should suffice to hold the path elements in a variable with a different name and deprecating the other).

ruippeixotog avatar Aug 11 '19 14:08 ruippeixotog