superfell/json2apex

JSON Identifier with dot produces Apex Class that fails to Compile: developer.email

bobbywhitesfdc opened this issue · 0 comments

Working with a response from an OAuth client_secret flow hosted by Apigee
{
"refresh_token_expires_in" : "0",
"developer.email" : "superfell@example.com",
"token_type" : "BearerToken",
"issued_at" : "1520478821362",
"client_id" : "redacted",
"access_token" : "kRxqmPr2b223uzTUGnndQhXWv8F4",
"application_name" : "redacted-id",
"scope" : "",
"expires_in" : "3599",
"refresh_count" : "0",
"status" : "approved"
}

The resulting Apex class won't compile because the member name is an illegal identifier.

Actual:
String developer.email;

Expected:
String developer_email; // some kind of transform that makes it a legal identifier