Constructing Responses from properties in different datatype files


I have created a number of datatype files that I have imported into my api.raml file. I would like to use elements of each as for different endpoints. I have tried a number of different approaches that have failed:

  1. Create another datatype file that could be used to construct a tailored response for each endpoint. It would have to have duplicate entries with other datatype files which does not make sense.

  2. It is not possible to use “uses” and break this into libraries or in a datatype file otherwise reference other files that I have found out.

Here is a conceptual example (that does not show errors in Studio - but of course does in the API Manger):

       type: object
        studentID: publishedInstructor.instructorID
        courses: courseinformation.courseID[]

In other words, I want a response that includes the instructorID from the publishedInstructor datatype file (I have messed with capitalization without fixing this (i.e., the datatype files have an initial capitol). For this instructorID, I would like to return an array of course information.


I would gladly help. Do you mind sharing your RAML libraries?


Thank you very much. I am trying to experiment to see if I can used libraries to help with this. no luck yet. For example I would like to use for example. one property for datatype file 1 and one property from datatype file number two. Say courseID from the CourseInformation.raml and studentFullName from the EnrolledStudent.raml file.

This system will not let me upload a tar file. I could email them.


Feel free to upload your files to and share the links here.

Also, have you looked at some of the examples here:


Thank you for the pointers. I looked at the examples and was getting close on the library example. It looks like you should put libraries in the datatypes folder by the examples (shapes). Could this be correct??

Also, I tried to upload a zip and was not able to make that work. It said zip files are not supported (tried both upper and lower case.


I got your gist and it looks fine.


Yes, but it does not work. Some people are suggesting that what I must do is define a schema for each of the different responses for each resources. It seems like that really duplicates the examples you would create anyway. Do you have any suggestions about where I could talk to someone about this?



Sure. Feel free to join our Slack workspace. There are tool-specific channels. Feel free to reach-out to me there, my username is: jstoiko.