title: Python swagger-client for shopware 6
body: <p>I have generated a Python client via the swagger-codegen-cli (v3) docker image in my GitLab ci pipline for a Shopware 6 shop.</p>
  <p>The problem I encounter is that every endpoint returns empty data. The strange part is that when I debug the client, I can see the data via the inspector. Then in one step before the data is returned, it tries to deserialize the data and it returns a dictionary without any data inside.</p>
  <pre><code>return_data = response_data
  if _preload_content:
      # deserialize response data
      if response_type:
          return_data = self.deserialize(response_data, response_type)
  </code></pre>
  <p>This is from the <code>__call_api()</code> function. When I inspect <code>response_data</code>, I can see it contains the data I need but <code>deserialize()</code> returns this:
  <code>{'data': None, 'included': None, 'links': None, 'meta': None}</code></p>
  <p>I know I could set the parameter <code>_preload_content</code> to false, but then I get the raw request response as a byte string and that kind of defeats the purpose of using a swagger client.</p>
  <ul>
  <li>Is it a problem of the specs from my shop?</li>
  <li>Is the codegen not working correctly?</li>
  <li>Or is the python generator from swagger the problem?</li>
  </ul>
  <p>EDIT:</p>
  <p>I narrowed the problem down to the <code>__init__()</code> function of all the Response classes which all inherit from the Success class:</p>
  <pre><code>    def __init__(self, data=None, links=None, *args, **kwargs):  # noqa: E501
          &quot;&quot;&quot;InlineResponse200156 - a model defined in Swagger&quot;&quot;&quot;  # noqa: E501
          self._data = None
          self._links = None
          self.discriminator = None
          if data is not None:
              self.data = data
          if links is not None:
              self.links = links
          Success.__init__(self, *args, **kwargs)
  </code></pre>
  <p>In the last step it calls the <code>__init__()</code> function of Success:</p>
  <pre><code>    def __init__(self, meta=None, links=None, data=None, included=None):  # noqa: E501
          &quot;&quot;&quot;Success - a model defined in Swagger&quot;&quot;&quot;  # noqa: E501
          self._meta = None
          self._links = None
          self._data = None
          self._included = None
          self.discriminator = None
          if meta is not None:
              self.meta = meta
          if links is not None:
              self.links = links
          self.data = data
          if included is not None:
              self.included = included
  </code></pre>
  <p>Since data is not passed to the constructor of Success and there <code>self.data</code> gets overwritten with 'None'.</p>
  <p>It seems the Python generator for swagger generates these constructors wrong. When I deleted the overwritten constructor in InlineResponse200156  it seemed to work, but since this issue is in all the generated classes that inherit success, I think the issue is in the generator itself.</p>