Code generation for validating json schemas