wrap-json: sync with upstream