Uploaded image for project: 'Teiid Spring Boot'
  1. Teiid Spring Boot
  2. TEIIDSB-190

REST with request payload throws an error

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.5.0, 8.0-tp1-1.4.x
    • None
    • core
    • None
    • DV Sprint 62
    • 0.5

      TEIID spring boot is expecting the payload to be a bean, and hence throws an error. POST without request body works fine without any issues.

      CREATE VIEW StockPrice (
      symbol string PRIMARY KEY,
      price double
      ) AS
      SELECT p.symbol, y.price
      FROM accounts.PRODUCT as p, TABLE(call invokeHttp(action=>'POST', endpoint=>QUERYSTRING('predict'), headers=>jsonObject('application/json' as "Content-Type"), request=>jsonObject('PLATINUM' as "customerClass"))) as x,
      JSONTABLE(JSONPARSE(x.result,true), '$' COLUMNS price double path '@.data.segment') as y

      No errors on build, when I query the odata endpoint, I see the following error.

      <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
      <code>TEIID30504</code>
      <message>
      TEIID30504 quotesvc: No bean named '

      {"customerClass":"PLATINUM"}

      ' available
      </message>
      </error>

            rhn-engineering-rareddy Ramesh Reddy
            snandakumar Sadhana Nandakumar (Inactive)
            Archiver:
            rhn-support-adandapa Aitik Dandapat

              Created:
              Updated:
              Resolved:
              Archived:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h