Enhance config api and upate model spec generator to incorporate discriminators