def json(self, validate=True, *args, **kwargs):
if validate:<EOL><INDENT>self.validate()<EOL><DEDENT>config = deepcopy(self.config)<EOL>config.update({'<STR_LIT:type>': '<STR_LIT>'})<EOL>return json.dumps(config, *args, **kwargs)<EOL>
returns a string formatted as **NetJSON DeviceConfiguration**;
performs validation before returning output;

``*args`` and ``*kwargs`` will be passed to ``json.dumps``;

:returns: string