Reference in RAML schema cause build.gradle to fail (requisition)

During my work on ticket OLMIS-836 which is, in a nutshell, about adding schema and endpoints to RAML I experienced the following:
When a reference is created in schema (with $ref), the build.gradle fail on copyRaml task with “Could not copy file” error.
The references I created were generated with restlet studio and they work without copy tasks. My temporary solution is using “type”:“string” in place of reference to object in schema but I think references are more proper approach to this problem.
Has anyone experienced similar problem and found a solution?

Problem fixed, the reference should contain only the entity name (e.g. program) instead of its full path (#/schema/program).