Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 14 additions & 109 deletions code/API_definitions/location-retrieval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ info:
- Check with the API provider whether a unique "secondary" phone number is already associated with each device and use the secondary phone number to identify the intended device if available.

<!-- CAMARA:MANDATORY:additional-error-responses:BEGIN -->

# Additional CAMARA error responses

The list of error codes in this API specification is not exhaustive. Therefore the API specification MAY not document some non-mandatory error statuses as indicated in `CAMARA API Design Guide`.

Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified in the `API Readiness Checklist` document associated to this API version.
Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified from the `x-camara-commonalities` field, the changelog and the metadata of the released API version.

As a specific rule, error `501 - NOT_IMPLEMENTED` can be only a possible error response if it is explicitly documented in the API.
<!-- CAMARA:MANDATORY:additional-error-responses:END -->
Expand All @@ -124,7 +125,7 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
x-camara-commonalities: 0.8.0
x-camara-commonalities: 0.9.0
externalDocs:
description: Product documentation at CAMARA
url: https://github.com/camaraproject/DeviceLocation
Expand Down Expand Up @@ -209,13 +210,13 @@ paths:
LOCATION_CIRCLE_WITH_DEVICE:
$ref: "#/components/examples/LOCATION_CIRCLE_WITH_DEVICE"
'400':
$ref: '../common/CAMARA_common.yaml#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequestWithRange400'
'401':
$ref: '../common/CAMARA_common.yaml#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
'404':
$ref: '#/components/responses/RetrieveLocationNotFound404'
$ref: '../common/CAMARA_common.yaml#/components/responses/IdentifierNotFound404'
'422':
$ref: '#/components/responses/RetrieveLocationUnprocessableEntity422'
security:
Expand Down Expand Up @@ -248,36 +249,12 @@ components:
maximum: 2147483647
description: Maximum surface in square meters which is accepted by the client for the location retrieval. Absence of maxSurface means "any surface size".
example: 1000000
Device:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Device'

DeviceResponse:
$ref: '../common/CAMARA_common.yaml#/components/schemas/DeviceResponse'

Area:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Area'

AreaType:
$ref: '../common/CAMARA_common.yaml#/components/schemas/AreaType'

Circle:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Circle'

Polygon:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Polygon'

PointList:
$ref: '../common/CAMARA_common.yaml#/components/schemas/PointList'

Point:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Point'

Latitude:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Latitude'

Longitude:
$ref: '../common/CAMARA_common.yaml#/components/schemas/Longitude'

Location:
type: object
description: Device location
Expand All @@ -300,58 +277,6 @@ components:
example: "2023-09-07T10:40:52Z"

responses:
Generic403:
description: Forbidden
headers:
x-correlator:
$ref: '../common/CAMARA_common.yaml#/components/headers/x-correlator'
content:
application/json:
schema:
allOf:
- $ref: '../common/CAMARA_common.yaml#/components/schemas/ErrorInfo'
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
examples:
GENERIC_403_PERMISSION_DENIED:
summary: Permission denied
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.
RetrieveLocationNotFound404:
description: Not found
headers:
x-correlator:
$ref: '../common/CAMARA_common.yaml#/components/headers/x-correlator'
content:
application/json:
schema:
allOf:
- $ref: '../common/CAMARA_common.yaml#/components/schemas/ErrorInfo'
- type: object
properties:
status:
enum:
- 404
code:
enum:
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_IDENTIFIER_NOT_FOUND:
summary: Identifier not found
description: Some identifier cannot be matched to a device
value:
status: 404
code: IDENTIFIER_NOT_FOUND
message: Device identifier not found.
RetrieveLocationUnprocessableEntity422:
description: Unprocessable Content
headers:
Expand All @@ -378,33 +303,13 @@ components:
- LOCATION_RETRIEVAL.UNABLE_TO_LOCATE
examples:
GENERIC_422_SERVICE_NOT_APPLICABLE:
summary: Service not applicable
description: Service not applicable for the provided identifier
value:
status: 422
code: SERVICE_NOT_APPLICABLE
message: The service is not available for the provided identifier.
GENERIC_422_MISSING_IDENTIFIER:
summary: Missing identifier
description: An identifier is not included in the request and the device or phone number identification cannot be derived from the 3-legged access token
value:
status: 422
code: MISSING_IDENTIFIER
message: The device cannot be identified.
GENERIC_422_UNSUPPORTED_IDENTIFIER:
summary: Unsupported identifier
description: None of the provided identifiers is supported by the implementation
value:
status: 422
code: UNSUPPORTED_IDENTIFIER
message: The identifier provided is not supported.
GENERIC_422_UNNECESSARY_IDENTIFIER:
summary: Unnecessary identifier
description: An explicit identifier is provided when a device or phone number has already been identified from the access token
value:
status: 422
code: UNNECESSARY_IDENTIFIER
message: The device is already identified by the access token.
$ref: '../common/CAMARA_common.yaml#/components/examples/GENERIC_422_SERVICE_NOT_APPLICABLE'
GENERIC_422_MISSING_IDENTIFIER_DEVICE:
$ref: '../common/CAMARA_common.yaml#/components/examples/GENERIC_422_MISSING_IDENTIFIER_DEVICE'
GENERIC_422_UNSUPPORTED_IDENTIFIER_DEVICE:
$ref: '../common/CAMARA_common.yaml#/components/examples/GENERIC_422_UNSUPPORTED_IDENTIFIER_DEVICE'
GENERIC_422_UNNECESSARY_IDENTIFIER_DEVICE:
$ref: '../common/CAMARA_common.yaml#/components/examples/GENERIC_422_UNNECESSARY_IDENTIFIER_DEVICE'
LOCATION_RETRIEVAL_422_UNABLE_TO_FULFILL_MAX_AGE:
summary: Unable to fulfill maxAge
description: The system is not able to provide the fresh location required by the client
Expand Down
95 changes: 14 additions & 81 deletions code/API_definitions/location-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ info:
- Check with the API provider whether a unique "secondary" phone number is already associated with each device and use the secondary phone number to identify the intended device if available.

<!-- CAMARA:MANDATORY:additional-error-responses:BEGIN -->

# Additional CAMARA error responses

The list of error codes in this API specification is not exhaustive. Therefore the API specification MAY not document some non-mandatory error statuses as indicated in `CAMARA API Design Guide`.

Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified in the `API Readiness Checklist` document associated to this API version.
Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified from the `x-camara-commonalities` field, the changelog and the metadata of the released API version.

As a specific rule, error `501 - NOT_IMPLEMENTED` can be only a possible error response if it is explicitly documented in the API.
<!-- CAMARA:MANDATORY:additional-error-responses:END -->
Expand All @@ -108,7 +109,7 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
x-camara-commonalities: 0.8.0
x-camara-commonalities: 0.9.0
externalDocs:
description: Product documentation at CAMARA
url: https://github.com/camaraproject/DeviceLocation
Expand Down Expand Up @@ -232,13 +233,13 @@ paths:
matchRate: 74
lastLocationTime: "2023-09-07T10:40:52Z"
"400":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic400"
$ref: "../common/CAMARA_common.yaml#/components/responses/BadRequestWithRange400"
"401":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic401"
$ref: "../common/CAMARA_common.yaml#/components/responses/Unauthenticated401"
"403":
$ref: "#/components/responses/Generic403"
$ref: "../common/CAMARA_common.yaml#/components/responses/PermissionDenied403"
"404":
$ref: "#/components/responses/VerifyLocationNotFound404"
$ref: "../common/CAMARA_common.yaml#/components/responses/IdentifierNotFound404"
"422":
$ref: "#/components/responses/VerifyLocationUnprocessableEntity422"
security:
Expand Down Expand Up @@ -360,58 +361,6 @@ components:
example: "2023-09-07T10:40:52Z"

responses:
Generic403:
description: Forbidden
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.

VerifyLocationNotFound404:
description: Not found
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_IDENTIFIER_NOT_FOUND:
description: Some identifier cannot be matched to a device
value:
status: 404
code: IDENTIFIER_NOT_FOUND
message: Device identifier not found.

VerifyLocationUnprocessableEntity422:
description: Unprocessable Content
headers:
Expand Down Expand Up @@ -439,29 +388,13 @@ components:
- LOCATION_VERIFICATION.UNABLE_TO_LOCATE
examples:
GENERIC_422_SERVICE_NOT_APPLICABLE:
description: Service not applicable for the provided identifier
value:
status: 422
code: SERVICE_NOT_APPLICABLE
message: The service is not available for the provided identifier.
GENERIC_422_MISSING_IDENTIFIER:
description: An identifier is not included in the request and the device or phone number identification cannot be derived from the 3-legged access token
value:
status: 422
code: MISSING_IDENTIFIER
message: The device cannot be identified.
GENERIC_422_UNSUPPORTED_IDENTIFIER:
description: None of the provided identifiers is supported by the implementation
value:
status: 422
code: UNSUPPORTED_IDENTIFIER
message: The identifier provided is not supported.
GENERIC_422_UNNECESSARY_IDENTIFIER:
description: An explicit identifier is provided when a device or phone number has already been identified from the access token
value:
status: 422
code: UNNECESSARY_IDENTIFIER
message: The device is already identified by the access token.
$ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_422_SERVICE_NOT_APPLICABLE"
GENERIC_422_MISSING_IDENTIFIER_DEVICE:
$ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_422_MISSING_IDENTIFIER_DEVICE"
GENERIC_422_UNSUPPORTED_IDENTIFIER_DEVICE:
$ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_422_UNSUPPORTED_IDENTIFIER_DEVICE"
GENERIC_422_UNNECESSARY_IDENTIFIER_DEVICE:
$ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_422_UNNECESSARY_IDENTIFIER_DEVICE"
LOCATION_VERIFICATION_422_AREA_NOT_COVERED:
summary: The area cannot be covered
description: The system is not able cover the requested area
Expand Down
18 changes: 9 additions & 9 deletions code/Test_definitions/location-retrieval.feature
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ Feature: CAMARA Device location retrieval API, vwip - Operation retrieveLocation
And the response property "$.message" contains a user friendly text

Examples:
| device_identifier | oas_spec_schema |
| $.device.phoneNumber | /components/schemas/PhoneNumber |
| $.device.ipv4Address | /components/schemas/DeviceIpv4Addr |
| $.device.ipv6Address | /components/schemas/DeviceIpv6Address |
| $.device.networkAccessIdentifier | /components/schemas/NetworkAccessIdentifier |
| device_identifier | oas_spec_schema |
| $.device.phoneNumber | #/components/schemas/PhoneNumber |
| $.device.ipv4Address | #/components/schemas/DeviceIpv4Addr |
| $.device.ipv6Address | #/components/schemas/DeviceIpv6Address |
| $.device.networkAccessIdentifier | #/components/schemas/NetworkAccessIdentifier |

@location_retrieval_C01.03_device_not_found
Scenario: Some identifier cannot be matched to a device
Expand Down Expand Up @@ -190,13 +190,13 @@ Feature: CAMARA Device location retrieval API, vwip - Operation retrieveLocation
And the response property "$.message" contains a user friendly text

Examples:
| input_property | oas_spec_schema |
| $.maxAge | /components/schemas/RetrievalLocationRequest/properties/maxAge |
| $.maxSurface | /components/schemas/RetrievalLocationRequest/properties/maxSurface |
| input_property | oas_spec_schema |
| $.maxAge | #/components/schemas/RetrievalLocationRequest/properties/maxAge |
| $.maxSurface | #/components/schemas/RetrievalLocationRequest/properties/maxSurface |

@location_retrieval_400.3_invalid_x-correlator
Scenario: Invalid x-correlator value
Given the header "x-correlator" does not comply with the OAS schema at "/components/schemas/XCorrelator"
Given the header "x-correlator" does not comply with the OAS schema at "#/components/schemas/XCorrelator"
When the request "retrieveLocation" is sent
Then the response status code is 400
And the response property "$.status" is 400
Expand Down
Loading
Loading