Given a current density distribution $\mathbf J(\mathbf x)$ inside a closed bounded region $\Omega$, the magnetic field at any point $\mathbf y$ outside of $\Omega$ can be expressed as $$ \begin{aligned}\mathbf B(\mathbf y)&=\frac{\mu_0}{4\pi}\int_\Omega\mathbf J(\mathbf x)\times\nabla_{\mathbf x}\frac{1}{|\mathbf x-\mathbf y|}d^3\mathbf x\\ &=\frac{\mu_0}{4\pi}\int_\Omega\left[\frac{1}{|\mathbf x-\mathbf y|}\nabla_{\mathbf x}\times\mathbf J(\mathbf x)-\nabla_{\mathbf x}\times\left(\frac{\mathbf J(\mathbf x)}{|\mathbf x-\mathbf y|}\right)\right]d^3\mathbf x\\ &=\frac{\mu_0}{4\pi}\int_\Omega\frac{1}{|\mathbf x-\mathbf y|}\nabla_{\mathbf x}\times\mathbf J(\mathbf x)d^3\mathbf x-\frac{\mu_0}{4\pi}\int_{\partial\Omega}\mathbf n(\mathbf x)\times\left(\frac{\mathbf J(\mathbf x)}{|\mathbf x-\mathbf y|}\right)d^2 S(\mathbf x) \end{aligned}$$ where $\partial\Omega$ is the boundary of $\Omega$, $n(\mathbf x)$ is the unit normal of $\partial \Omega$ and $S(\mathbf x)$ is the area of the surface element. Now, if the current density $\mathbf J(\mathbf x)$ is zero at the boundary $\partial\Omega$ (this can be achieved by slightly enlarging $\Omega$ if $\mathbf J(\mathbf x)$ is not zero at $\partial\Omega$) we can then drop the second term on the last line. Now we simply have $$ \begin{aligned}\mathbf B(\mathbf y)&=\frac{\mu_0}{4\pi}\int_\Omega\frac{1}{|\mathbf x-\mathbf y|}\nabla_{\mathbf x}\times\mathbf J(\mathbf x)d^3\mathbf x \end{aligned}.$$
If the current density $\mathbf J(\mathbf x)$ is continuous and differentiable, the above conclusion should be correct. However, $\mathbf J(\mathbf x)$ might not be continuous in $\Omega$, e.g., infinite thin coils inside $\Omega$ carrying electrical current. Is the above derivation correct for $\mathbf J(\mathbf x)$ containing delta functions? What kind of singularities in $\mathbf J(\mathbf x)$ is permitted?