<p>I am trying to define a deployment spec using the C#-client of Kubernetes. The values of the fields of my spec are produced by some other application. As such, the deployment sometimes fails and I get an <code>Unprocessable entity</code>(Microsoft.Rest.HttpOperationException) error. However, it is really hard to identify which field results in the Unprocessable entity error.</p>

<p>Can someone tell me how I could get identify the erroneous field?</p>

<p>Here's the trace:</p>

<pre><code>Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'UnprocessableEntity'
   at k8s.Kubernetes.CreateNamespacedDeploymentWithHttpMessagesAsync(V1Deployment body, String namespaceParameter, String dryRun, String fieldManager, String pretty, Dictionary`2 customHeaders, CancellationToken cancellationToken)
   at k8s.KubernetesExtensions.CreateNamespacedDeploymentAsync(IKubernetes operations, V1Deployment body, String namespaceParameter, String dryRun, String fieldManager, String pretty, CancellationToken cancellationToken)
   at k8s.KubernetesExtensions.CreateNamespacedDeployment(IKubernetes operations, V1Deployment body, String namespaceParameter, String dryRun, String fieldManager, String pretty)
</code></pre>

<p>I was able to get a more detailed error by printing out the Response.Content field of the Microsoft.Rest.HttpOperationException.</p>

<pre><code>try
{
    // Code for deployment
}
catch(Microsoft.Rest.HttpOperationException e)
{
    Console.WriteLine(e.Response.Content);
}
</code></pre>
