Uploaded image for project: 'mod-inventory-storage'
  1. mod-inventory-storage
  2. MODINVSTOR-1029

Future<Void> BoundWithAPI.isValid, not Future<Boolean>

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • None
    • None
    • None
    • Sif Sprint 158
    • Sif
    • Orchid (R1 2023)
    • Implementation coding issue

    Description

      The BoundWithAPI.isValid method returns a Future<Boolean>. If the validation fails the Future succeeds with a false boolean.

      However, Futures are designed to return failures as a failed Future.

      Therefore Future<Void> should be returned so that the caller of isValid can better handle the error.

      The org.folio.rest.exceptions.ValidationException can be used. This also fixes the error response that currently doesn't comply with the RAML error response spec:

      {
        "map" : {
          "holdings" : {
            "list" : [ "Holdings record 5dad1351-1a77-447b-b5fe-a14c2ed280e2 not found." ],
            "empty" : false
          }
        },
        "empty" : false
      }
      

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases