Add models from relations

/to @bajtos 
/cc @STRML

The PR adds related models into the Swagger spec so that REST operations for relations are correctly typed.
One more question: what is the reasoning for changing the type of the first parameter from `SharedClass` to `ModelCtor`? Most of the swagger-related code operates on `SharedClass`, it seems to me this change is introducing inconsistency.