I am attempting to deserialise a JSON response with some variables that Salesforce is having a problem handling because there is a '.' in the object name (as well as a '.' in some variable names).
Here's part of the JSON file:
{
"gon.features": {
"gon.app_is_ready": false,
"show_newcomers_with_featured_field": true,
"registration_and_onboarding_flow": true,
"app_tracking_business_model_enabled": true,
"product_page_enabled": true,
"show_new_pricing_page": true,
"change_advanced_search_path_to_markets": true,
"publisher_portfolio_page": true,
"app_country_split_page": true,
"advanced_search_toggle_view": true
}
}
And my JSON deserialise object for it:
class cls_gon.features {
public Boolean gon.app_is_ready;
public boolean show_newcomers_with_featured_field;
public boolean registration_and_onboarding_flow;
public boolean app_tracking_business_model_enabled;
public boolean product_page_enabled;
public boolean show_new_pricing_page;
public boolean change_advanced_search_path_to_markets;
public boolean publisher_portfolio_page;
public boolean app_country_split_page;
public boolean advanced_search_toggle_view;
}
The error I am getting is:
Invalid identifier: gon.features
Is there a way to handle for the variables/objects containing '.' in their name? Changing the JSON response unfortunately isn't an option...