Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-3661

REST call for collection can return 404 error

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.0.0-RC3
    • 2.0.0
    • Viewer RO

    Description

      When doing a REST call for finding values and expecting a collection of objects back there is an inconsistency with Causeway (2.x) vs Isis (1.x).

      When querying for a value that returns an empty list:

      For 1.x the result is an empty collection.

      For 2.x the result is a http 404 error.

      It's a matter of what to return for an empty collection versus an empty object.

      The functionality for this is located at:
      ContentNegotiationServiceXRoDomainType#buildResponse
       
      Possible solutions may be:

      • Don't change anything, the REST client should handle this
      • Add logic that checks the return type and returns an empty collection in the ContentNegotiationServiceXRoDomainType#buildResponse method
      • Add logic that checks and returns an empty collection in the 
        _ManagedObjectEmpty#getPojo method
      • Create a _ManagedCollectionEmpty or
        _ManagedListEmpty object for wrapping the return value of an empty Collection
      • None of the above

      Attachments

        Issue Links

          Activity

            People

              danhaywood Daniel Keir Haywood
              ocs_wove ocs_wove
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: