There is a method in our application that returns api object schema as json. I am trying to figure out if there is anyway to pull out the property names. For instance, I receive the following json text (after deserialization):
"json": {
"CompanyId": null,
"Name": null,
"UniqueIdentity": null,
"AccountCode": null,
"IsActive": null,
"ContractNumber": null,
"IsSiteCompany": null,
"TaxCode": null,
"GLCode": null,
"CompanyTypeId": null,
"AddressInfo": [
{
"AddressId": null,
"CompanyId": null,
"AddressTypeId": null,
"Phone": null,
"Fax": null,
"Address": null,
"Address2": null,
"City": null,
"State": null,
"Zip": null,
"Country": null
}
],
"ContactInfo": [
{
"ContactId": null,
"CompanyId": null,
"ContactTypeId": null,
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Alias": null,
"Position": null,
"Email": null,
"Phone": null,
"IsPrimaryContact": null
}
]
I need to pull out the property names like CompanyId, Name, etc. I know I can create a class and deserialize into the class object, the problem is, I never know what the schema will be. It will not always be what is above. I know I can pick the text apart bit by bit to come up with the property names, but I was wondering if anyone knew of anything that already exists that can accomplish this task.