Marrah A. - The JSON Generator uses the Apache Velocity engine, which does allow you to use variable references (i.e. $dirPath) and pipeline parameter references (i.e. ${_myPath}) but not expression library references (i.e. lib.server.sftp).
My recommendation is to use a Mapper snap to get the expression library reference, then use the JSON Generator if you need to do more around that. I have attached a sample pipeline to demonstrate.