Coherent x-ray diffractive imaging is a nondestructive technique that extracts three-dimensional electron density and strain maps from materials with nanometer resolution. It has been utilized for materials in a range of applications, and has significant potential for imaging buried nanostructures in functional devices. Here, we show that coherent x-ray diffractive imaging is able to bring new understanding to a lithography-based nanofabrication process for engineering the optical properties of semiconducting GaAs1-yNy on a GaAs substrate. This technique allows us to test the process reliability and the manufactured patterns quality. We demonstrate that regular and sharp geometrical structures can be produced on a few-micron scale, and that the strain distribution is uniform even for highly strained sub-microscopic objects. This nondestructive study would not be possible using conventional microscopy techniques. Our results pave the way for tailoring the optical properties of emitters with nanometric precision for nanophotonics and quantum technology applications.