Skip to content

Add error 422 unable to locate#348

Merged
jlurien merged 2 commits intomainfrom
add_error_422_UNABLE_TO_LOCATE
Jul 1, 2025
Merged

Add error 422 unable to locate#348
jlurien merged 2 commits intomainfrom
add_error_422_UNABLE_TO_LOCATE

Conversation

@jlurien
Copy link
Collaborator

@jlurien jlurien commented Jun 19, 2025

What type of PR is this?

  • enhancement/feature

What this PR does / why we need it:

  • location-verification

    • Deprecates 200 verificationResult=UNKNOWN in favor of new error 422 LOCATION_VERIFICATION.UNABLE_TO_LOCATE
    • Response property lastLocationTime becomes required as UNKNOWN was the only case when it was allowed to not be filled
    • info.description and test plan adjusted accordingly
  • location-retrieval

    • Deprecates erro 404 LOCATION_RETRIEVAL.DEVICE_NOT_FOUND in favor of new error 422 LOCATION_RETRIEVAL.UNABLE_TO_LOCATE
    • info.description and test plan adjusted accordingly

Which issue(s) this PR fixes:

Fixes #308

Special notes for reviewers:

Changelog input

* New error 422 <API_NAME>.UNABLE_TO_LOCATE in both location-verification and location-retrieval for scenarios where the device cannot be located

@jlurien jlurien requested a review from Copilot June 19, 2025 09:37

This comment was marked as outdated.

@github-actions
Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 2 0 0.03s
✅ OPENAPI spectral 3 0 4.98s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY secretlint yes no 0.73s
✅ YAML yamllint 3 0 0.8s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@jlurien jlurien requested a review from Copilot June 19, 2025 09:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the legacy UNKNOWN/404 responses with new 422 UNABLE_TO_LOCATE errors for both location verification and retrieval, makes lastLocationTime required in the verification response, and updates tests and API docs accordingly.

  • Remove the UNKNOWN scenario in verification and add a 422 LOCATION_VERIFICATION.UNABLE_TO_LOCATE scenario
  • Change retrieval tests to expect 422 LOCATION_RETRIEVAL.UNABLE_TO_LOCATE instead of 404
  • Update OpenAPI YAMLs: deprecate UNKNOWN/DEVICE_NOT_FOUND, require lastLocationTime, and add new 422 error definitions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
code/Test_definitions/location-verification.feature Removed old UNKNOWN scenario; added new 422 UNABLE_TO_LOCATE scenario without header/schema checks
code/Test_definitions/location-retrieval.feature Switched expected status from 404 to 422 and updated error code in the retrieval scenario
code/API_definitions/location-verification.yaml Deprecated UNKNOWN responses, added lastLocationTime to required props, and defined new 422 error
code/API_definitions/location-retrieval.yaml Updated docs for maxAge, removed DEVICE_NOT_FOUND from 404 enum, and added new 422 error
Comments suppressed due to low confidence (2)

code/Test_definitions/location-verification.feature:325

  • Add assertions to verify response headers (Content-Type, x-correlator) and validate the error response body against the OAS error schema to ensure consistency with other scenarios.
  @location_verification_422.4_unknown_location_for_device

code/Test_definitions/location-retrieval.feature:68

  • Include checks for response headers (Content-Type, x-correlator) and schema compliance for the new 422 error to match coverage in other retrieval scenarios.
    Then the response status code is 422

@maxl2287 maxl2287 added enhancement New feature or request Fall25 Meta-release Fall25 labels Jun 23, 2025
@jlurien
Copy link
Collaborator Author

jlurien commented Jul 1, 2025

@bigludo7 please review this one

Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jlurien jlurien merged commit 4f10aff into main Jul 1, 2025
2 checks passed
@jlurien jlurien deleted the add_error_422_UNABLE_TO_LOCATE branch September 1, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Fall25 Meta-release Fall25

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behavior between Verify Location and Retrieve Location when a device is roaming

4 participants