Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5599

When creating an entity via POST message, it is expected, that the returned message includes the primary key of the newly created instance. This is not the case currently

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 11.2.2, 12.0.1, 12.1
    • None
    • None
    • None

      The following communication shows the issue. What I am doing here is to create a new Account entity via post request. My underlaying mysql database requires the primary key in the table to be set to NN (not null), hence, a value must be provided. Moreover the primary key is set to autoincrement and is generated by the database. The only execepted value here seems to be, to provide the key with value=0. The object is created in the database as expected. However, Teiid answers with the created object, but again with the primary key (idProfile) set as zero, instead to provide the newly created primary key.

      POST Account HTTP/1.1
      Accept:application/json;odata.metadata=minimal;IEEE754Compatible=true
      Accept-Language:de-DE
      Content-Type:application/json;charset=UTF-8;IEEE754Compatible=true

      {"uuidUser":"65820574-7525-463b-9d20-5ee133a06b94","idProfile":"0"}

      --batch_id-1547485733072-21
      Content-Type:application/http
      Content-Transfer-Encoding:binary

      The response:

      HTTP/1.1 201 Created
      Location: http://localhost/odata4/svc/my_nutri_diary/Account(0)
      Content-Type: application/json;ieee754compatible=true;odata.metadata=minimal
      Content-Length: 147

      {"@odata.context":"http://localhost/odata4/svc/my_nutri_diary/$metadata#Account","idProfile":"0","uuidUser":"65820574-7525-463b-9d20-5ee133a06b94"}

      --batch_e834eb7c-df0d-4e22-a423-78cd3638955f
      Content-Type: application/http
      Content-Transfer-Encoding: binary

              rhn-engineering-shawkins Steven Hawkins
              cjohn001 Christoph John (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: