ContentType and FieldResouces are not sending FieldVariables
When we send the json representation of a content type, we need to include the json representation of the fields, and whenever we send the json representation of a fields, we need to include the json representation of the field variables as well.

PR Core (Release 4.1 - Cherry-Pick): https://github.com/dotCMS/core/pull/11539
Passed QA. Now json representation of a content type includes the json representation of the fields:
{
"errors": [],
"entity": {
"owner": "dotcms.org.1",
"multilingualable": false,
"modDate": 1495821863000,
"versionable": true,
"defaultType": false,
"system": false,
"folder": "SYSTEM_FOLDER",
"name": "test contet type 1",
"variable": "Testcontettype1",
"host": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"fixed": false,
"id": "39d74656-0d32-40f0-bd1c-fb8ea115cc66",
"fields": [
{
"modDate": 1495821863000,
"indexed": false,
"dataType": "SYSTEM",
"contentTypeId": "39d74656-0d32-40f0-bd1c-fb8ea115cc66",
"readOnly": false,
"searchable": false,
"required": false,
"listed": false,
"unique": false,
"sortOrder": 2,
"name": "testBinary",
"variable": "testBinary",
"fieldVariables": [
{
"id": "153419d0-9283-4ba8-9ab8-ba38335ab425",
"clazz": "com.dotcms.contenttype.model.field.ImmutableFieldVariable",
"value": "testvalue1",
"key": "testkey1",
"fieldId": "a2348db6-db63-430a-af3c-efa4e5998d60"
}
],
"fixed": false,
"id": "a2348db6-db63-430a-af3c-efa4e5998d60",
"clazz": "com.dotcms.contenttype.model.field.ImmutableBinaryField",
"iDate": 1495821720000
},
{
"modDate": 1495821838000,
"indexed": true,
"dataType": "TEXT",
"contentTypeId": "39d74656-0d32-40f0-bd1c-fb8ea115cc66",
"readOnly": false,
"searchable": true,
"required": false,
"listed": true,
"unique": false,
"sortOrder": 3,
"name": "testText",
"variable": "testText",
"fieldVariables": [
{
"id": "aa5a5794-99c7-445e-b7d8-724d80884193",
"clazz": "com.dotcms.contenttype.model.field.ImmutableFieldVariable",
"value": "testkey1",
"key": "testkey1",
"fieldId": "1e22cd29-b6ec-464a-b976-7798255680d1"
}
],
"fixed": false,
"id": "1e22cd29-b6ec-464a-b976-7798255680d1",
"clazz": "com.dotcms.contenttype.model.field.ImmutableTextField",
"iDate": 1495821752000
}
],
"clazz": "com.dotcms.contenttype.model.type.ImmutableSimpleContentType",
"iDate": 1495821685000
},
"messages": [],
"i18nMessagesMap": {}
}
In addition, json representation of fields includes the json representation of the field variables as well.
{
"errors": [],
"entity": [
{
"modDate": 1495821863000,
"indexed": false,
"dataType": "SYSTEM",
"contentTypeId": "39d74656-0d32-40f0-bd1c-fb8ea115cc66",
"readOnly": false,
"searchable": false,
"required": false,
"listed": false,
"unique": false,
"sortOrder": 2,
"name": "testBinary",
"variable": "testBinary",
"fieldVariables": [
{
"id": "153419d0-9283-4ba8-9ab8-ba38335ab425",
"clazz": "com.dotcms.contenttype.model.field.ImmutableFieldVariable",
"value": "testvalue1",
"key": "testkey1",
"fieldId": "a2348db6-db63-430a-af3c-efa4e5998d60"
}
],
"fixed": false,
"id": "a2348db6-db63-430a-af3c-efa4e5998d60",
"clazz": "com.dotcms.contenttype.model.field.ImmutableBinaryField",
"iDate": 1495821720000
},
{
"modDate": 1495821838000,
"indexed": true,
"dataType": "TEXT",
"contentTypeId": "39d74656-0d32-40f0-bd1c-fb8ea115cc66",
"readOnly": false,
"searchable": true,
"required": false,
"listed": true,
"unique": false,
"sortOrder": 3,
"name": "testText",
"variable": "testText",
"fieldVariables": [
{
"id": "aa5a5794-99c7-445e-b7d8-724d80884193",
"clazz": "com.dotcms.contenttype.model.field.ImmutableFieldVariable",
"value": "testkey1",
"key": "testkey1",
"fieldId": "1e22cd29-b6ec-464a-b976-7798255680d1"
}
],
"fixed": false,
"id": "1e22cd29-b6ec-464a-b976-7798255680d1",
"clazz": "com.dotcms.contenttype.model.field.ImmutableTextField",
"iDate": 1495821752000
}
],
"messages": [],
"i18nMessagesMap": {}
}
Tested on dotcms 4.1.0 distribution generated from realease-4.1 on commit 7bfb5dc5c7c460fcd0628978cb4468aaf7283d67 Mac OS 10.10 / MySQL 5.6.35 / Firefox v45.0.1 / Tomcat 8 / Java 8