title: SWAGGER: Dereferencing $ref from body parameter
body: <p>Taking the petstore example,</p>
  
  <p>I am trying to dereference the $Ref in the /pet -> put operation which is currently:
  schema
  $ref: #definitions/Pet</p>
  
  <p>I am trying to resolve this but unable to get this text out from the json file.
  This is what I have:</p>
  
  <p>BodyParameter bp = (BodyParameter) param;
  System.out.println(((RefModel) bp.getSchema()).get$ref());</p>
  
  <p>I thought this would give me the above text out which I could later map with  a definition Map and resolve it but got the following error:</p>
  
  <p>Exception in thread "main" java.lang.ClassCastException: io.swagger.models.ModelImpl cannot be cast to io.swagger.models.RefModel</p>
  
  <p>Would anyone know of a way to extract this string out from a body parameter and in general since the schema returns a Type Model?
  I do not find a proper documentation source for the swagger parser , swagger inflector projects so hunting around through the source code itself.</p>