Fixed choose_swing json encoding logic