Skip to content

Clarification on expected error code when maxAge is absent and device location cannot be determined #388

@JayVaishnavNio

Description

@JayVaishnavNio

Hi Team,

While reviewing the retrieveLocation API behavior, we noticed a potential discrepancy between the YAML specification and our current Gherkin scenario for devices that cannot be located:

Current Gherkin scenario:

  • Device exists but cannot be located (@location_retrieval_404_unable_to_locate_device)
  • maxAge is not included
  • Expected response: 404 / LOCATION_RETRIEVAL.DEVICE_NOT_FOUND

YAML specification:

  • Absence of maxAge means “any age” is acceptable (i.e., last known location)
  • If the system cannot provide location, the response should be 422 / LOCATION_RETRIEVAL.UNABLE_TO_LOCATE

Analysis:

  • 404 should be returned only if the device does not exist or is invalid.
  • 422 is more appropriate if the device exists but the system cannot retrieve its location.
  • Therefore, for a valid device with maxAge missing, and location unavailable, the API should return 422 / UNABLE_TO_LOCATE, not 404.

Suggested Action:

  • Update the Gherkin scenario to expect 422 / LOCATION_RETRIEVAL.UNABLE_TO_LOCATE for existing devices.
  • Keep 404 reserved for truly non-existent devices.

This will align the test cases with the YAML spec and standard REST semantics.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsImprovements or additions to test-definitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions