<p>Developing CRDs for Kubernetes, using VScode as an IDE. Want to provide autocompletion and Intellisense in IDE.</p>
<p>It needs a JSON schema to do so. I have a huge number of CRDs to support. I want to do it in an easy way to convert CRDs to JSON schema.</p>

<p>You can export the swagger definition (including your CRDs) of your Kubernetes server and then generate the json schema from the swagger export.</p>
<p>Create a proxy to your API server and export the swagger</p>
<pre><code>kubectl proxy --port=8080
curl localhost:8080/openapi/v2 &gt; k8s-swagger.json
</code></pre>
<p>Using <a href="https://github.com/instrumenta/openapi2jsonschema" rel="nofollow noreferrer">openapi2jsonschema</a> generate the json schemas</p>
<pre><code>openapi2jsonschema -o &quot;schemas&quot; --kubernetes --stand-alone k8s-swagger.json
</code></pre>
