camaraproject / DeviceLocation

Repository to describe, develop, document and test the DeviceLocation API family
Apache License 2.0
21 stars 32 forks source link

Enhancing response to cover partial matches #20

Closed jlurien closed 1 year ago

jlurien commented 1 year ago

Current response model just allows true/false as verificationResult, but there are scenarios where this result is not that straight-forward.

Let's review the following possible scenarios: image

where

Scenarios

To address the different scenarios more properly, the response would need to be enhanced. An initial proposal:

    VerifyLocationResponse:
      type: object
      required:
        - verification_result
      properties:
        verification_result:
          $ref: '#/components/schemas/VerificationResult'
        match_rate:
          $ref: '#/components/schemas/MatchRate'
    VerificationResult:
      description: |-
        Verification request result:
        * `TRUE`: when the Network locates the device within the requested area
        * `FALSE`: when the requested area completely differs from the area where the Network locates the device
        * `PARTIAL` when the requested area is partially included in the area where the Network locates the device but not entirely. In this case `success_rate` must be included in the response
        * `UNDETERMINED` when the network cannot satisfy the requested accuracy in the request. Client may trigger a new request with a higher value for requested accuracy
        * `UNKNOWN` when the network cannot locate the requested device
      type: string
      enum:
        - TRUE
        - FALSE
        - PARTIAL
        - UNDETERMINED
        - UNKNOWN
    MatchRate:
      description: Match rate estimation for the location verification in percent
      type: integer
      minimum: 0
      maximum: 100
      example: 74

The value unknown would solve as well the issue #19.

jlurien commented 1 year ago

Closing issue as PR is already merged. We may open a further issue to discuss on implementation details