Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.