How to use $ref to take information from environment

I’m making schema tests. And I want to store all schema’s that I will need to reuse into environment and then take them by using $ref. Is this possible? And can I have an example on how to do it?

See How to save schema to environment and reuse it after