Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-11452

No way to specify alternative response for API Provider based on request and previous steps outcome

    XMLWordPrintable

Details

    • % %

    Description

      (Migrated from https://github.com/syndesisio/syndesis/issues/3999)

      Author: Andrej Smigala
      Assignees: unassigned

      This is a...

      [pre][code]
      [ ] Feature request
      [ ] Regression (a behavior that used to work and stopped working in a new release)
      [x] Bug report [!-- Please search GitHub for a similar issue or PR before submitting --]
      [ ] Documentation issue or request
      [/code][/pre]

      Description

      When implementing API Provider operations, there is no way to gracefully handle situations when e.g. a requested item does not exist or a POSTed item already exists. These situations end up returning the stack trace in the body and 500 as the response status.

      Steps to reproduce

      (note this is just an example, there are other situations where we would want to change the response based on the outcome of previous steps)
      1. Create an API Provider integration from the TODO API spec
      2. Implement the Fetch task operation
      3. Add a postgres connection with

      select * from todo where id = :#id

      4. Add the appropriate mappings from the request to postgres and from postgres to response
      5. Publish the integration
      6. Go to

      {integration-url}

      /api/42 (or some other non-existent id) in the browser, the full stacktrace is returned with http status 500

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-hbraun Heiko Braun
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: