<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Converting data to c# classes in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Converting-data-to-c-classes/m-p/2030829#M17998</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_2" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.qlik.com/t5/user/viewprofilepage/user-id/151887" target="_self" aria-label="View Profile of Spartan27215" aria-describedby="userProfileCard-151887"&gt;&lt;SPAN class=""&gt;Spartan27215&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need to serialize other attributes than the "data" list? (I.e. "meta", "links", "prev", "self"). If this is not needed, you should simply be able to serialize just the "data" attributes.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;In order to convert the JSON information for a space into&amp;nbsp; a "Space.cs" object for example, you could add a specific &lt;STRONG&gt;JsonProperty &lt;/STRONG&gt;(from the "Newtonsoft.Json" package)&amp;nbsp;to the fields that you want to serialize in a specific way. For example, if you had such a Space.cs object class, you could define the field "Enum", and add the JsonProperty "enum". This way, the "enum" json field is converted into the "Enum" object field when you serialize, and reverse when you deserialize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[JsonProperty("enum")]
public string Enum{ get; set; }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;PythonMCSJ&lt;/P&gt;</description>
    <pubDate>Sat, 28 Jan 2023 17:32:59 GMT</pubDate>
    <dc:creator>PythonMCSJ</dc:creator>
    <dc:date>2023-01-28T17:32:59Z</dc:date>
    <item>
      <title>Converting data to c# classes</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Converting-data-to-c-classes/m-p/2026866#M17957</link>
      <description>&lt;P&gt;I am having an&amp;nbsp;issue at the moment with the conversion of the Json response data for the Spaces R$est API. the documentation shows the Json (see below), the problem the use of META is repeated with different properties which causes serialization issues and "enum" is a C# datatype. Anyone have a good way to get this data. I am using C# .NET Core?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="js"&gt;{
  "data": [
    {
      "id": "string",
      "meta": {
        "roles": [],
        "actions": [],
        "assignableRoles": {
          "enum": [
            "facilitator",
            "consumer",
            "producer",
            "dataconsumer"
          ],
          "type": "string",
          "description": "The supported roles for Shared spaces.",
          "dereferenced": "#/definitions/SharedSpaceRoleType"
        }
      },
      "name": "string",
      "type": "shared",
      "links": {
        "self": {
          "href": "string"
        },
        "assignments": {
          "href": "string"
        }
      },
      "ownerId": "string",
      "tenantId": "string",
      "createdAt": "2023-01-17T22:34:54.458Z",
      "createdBy": "string",
      "updatedAt": "2023-01-17T22:34:54.458Z",
      "description": "string"
    }
  ],
  "meta": {
    "count": 0,
    "personalSpace": {
      "actions": [],
      "resourceType": "string"
    }
  },
  "links": {
    "next": {
      "href": "string"
    },
    "prev": {
      "href": "string"
    },
    "self": {
      "href": "string"
    }
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 22:38:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Converting-data-to-c-classes/m-p/2026866#M17957</guid>
      <dc:creator>Spartan27215</dc:creator>
      <dc:date>2023-01-17T22:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting data to c# classes</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Converting-data-to-c-classes/m-p/2030829#M17998</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_2" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.qlik.com/t5/user/viewprofilepage/user-id/151887" target="_self" aria-label="View Profile of Spartan27215" aria-describedby="userProfileCard-151887"&gt;&lt;SPAN class=""&gt;Spartan27215&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need to serialize other attributes than the "data" list? (I.e. "meta", "links", "prev", "self"). If this is not needed, you should simply be able to serialize just the "data" attributes.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;In order to convert the JSON information for a space into&amp;nbsp; a "Space.cs" object for example, you could add a specific &lt;STRONG&gt;JsonProperty &lt;/STRONG&gt;(from the "Newtonsoft.Json" package)&amp;nbsp;to the fields that you want to serialize in a specific way. For example, if you had such a Space.cs object class, you could define the field "Enum", and add the JsonProperty "enum". This way, the "enum" json field is converted into the "Enum" object field when you serialize, and reverse when you deserialize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[JsonProperty("enum")]
public string Enum{ get; set; }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;PythonMCSJ&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jan 2023 17:32:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Converting-data-to-c-classes/m-p/2030829#M17998</guid>
      <dc:creator>PythonMCSJ</dc:creator>
      <dc:date>2023-01-28T17:32:59Z</dc:date>
    </item>
  </channel>
</rss>

