Make sure nested/referenced models are mapped to swagger

/to @ritch 
/cc @kraman 

The PR fixes an issue reported by @kraman where he uses nested models which weren't mapped to swagger.