added logic to leverage plugin definition schema if it exists