title: Swagger/NSwag: Redefine Parameter Type
body: <p>We are using swagger / nswag for documentation of a webapi project.</p>
  
  <p>As BodyParameters for the ActionMethods we use classes with the suffix Command, that contain parameters for e.g. creating a Domain-Object persisted in a database. </p>
  
  <p>A Command-Class could look like this:</p>
  
  <pre><code>public class CreateChildCommand {
      public Parent Parent { get; set; }
      public int Position { get; set; }
  }
  </code></pre>
  
  <p>While Position is a simple int, Parent is a Domain-Class persisted in a database. May it look somehow like this:</p>
  
  <pre><code>public class Parent {
  
      public Guid Id { get; set; }
      public string Name { get; set; }
      ...
  }
  </code></pre>
  
  <p>It can be loaded from database by its Id, so we just pass the id as parameter in the Json for the Command-Parameter like this:</p>
  
  <pre><code>{
      "Position": 3,
      "Parent": "41E71207-7F1E-4895-8BCC-14E1293A7907"
  }
  </code></pre>
  
  <p>When deserializing the Json the parent gets loaded by its Id via a Dao. 
  The problem now is, that swagger/nswag doesn't understand that "magic" and displays the parameters for the method like this:</p>
  
  <pre><code>{
      "Position": number,
      "Parent": {
           Id: "Guid",
           "Name": "string",
           ...
      }
  }
  </code></pre>
  
  <p>Is there any way to tell swagger to replace the Type for parent to make it look like this:</p>
  
  <pre><code>{
      "Position": "int",
      "Parent": "Guid"
  }
  </code></pre>