def segments
import ezmcp@0.1.0.0/src/openapi.bend as Openapiimport Base
678# the pieces of a split path that are not empty
679def segments(parts: List<&2, String>) -> List<&2, String>:
680 match parts:
681 case []:
682 []
683 case +part <> rest:
684 segments.at(String.is_empty(part), part, segments(rest))