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
146 changes: 20 additions & 126 deletions code/API_definitions/qos-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ info:

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 @@ -71,7 +71,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: wip
x-camara-commonalities: 0.8.0
x-camara-commonalities: 0.9.0


externalDocs:
Expand Down Expand Up @@ -102,7 +102,7 @@ paths:
- If the access token is 3-legged, all returned QoS Profiles will be available to the subject (device) associated with the access token.
- If the access token is 2-legged and a device filter is provided, all returned QoS Profiles will be available to that device. If multiple device identifiers are provided within the device property, only QoS Profiles available to the device identifier chosen by the implementation will be returned, even if the identifiers do not match the same device. API provider does not perform any logic to validate/correlate that the indicated device identifiers match the same device. No error should be returned if the identifiers are otherwise valid to prevent API consumers correlating different identifiers with a given end user.
- This call uses the POST method instead of GET to comply with the CAMARA Commonalities guidelines for sending sensitive or complex data in API calls. Since the device field may contain personally identifiable information, it should not be sent via GET. Additionally, this call may include complex data structures.
[CAMARA API Design Guidelines](https://github.com/camaraproject/Commonalities/blob/r4.3/documentation/CAMARA-API-Design-Guide.md#65-post-or-get-for-transferring-sensitive-or-complex-data)
[CAMARA API Design Guidelines](https://github.com/camaraproject/Commonalities/blob/r4.4/documentation/CAMARA-API-Design-Guide.md#65-post-or-get-for-transferring-sensitive-or-complex-data)

security:
- openId:
Expand Down Expand Up @@ -134,17 +134,17 @@ paths:
List of QoS Profiles:
$ref: "#/components/examples/LIST_OF_QOS_PROFILES"
"400":
$ref: "#/components/responses/Generic400"
$ref: "../common/CAMARA_common.yaml#/components/responses/BadRequest400"
"401":
$ref: "#/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/RetrieveQosProfilesNotFound404"
$ref: "../common/CAMARA_common.yaml#/components/responses/IdentifierNotFound404"
"422":
$ref: "#/components/responses/Generic422"
$ref: "#/components/responses/RetrieveQosProfilesUnprocessable422"
"429":
$ref: "#/components/responses/Generic429"
$ref: "../common/CAMARA_common.yaml#/components/responses/TooManyRequests429"

/qos-profiles/{name}:
get:
Expand Down Expand Up @@ -179,15 +179,15 @@ paths:
schema:
$ref: "#/components/schemas/QosProfile"
"400":
$ref: "#/components/responses/Generic400"
$ref: "../common/CAMARA_common.yaml#/components/responses/BadRequest400"
"401":
$ref: "#/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/NotFound404"
$ref: "../common/CAMARA_common.yaml#/components/responses/NotFound404"
"429":
$ref: "#/components/responses/Generic429"
$ref: "../common/CAMARA_common.yaml#/components/responses/TooManyRequests429"

components:
securitySchemes:
Expand Down Expand Up @@ -513,98 +513,7 @@ components:
$ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"

responses:
Generic400:
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic400"

Generic401:
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic401"

Generic403:
description: Forbidden
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/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.

NotFound404:
description: Not found
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.

RetrieveQosProfilesNotFound404:
description: Not found
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- NOT_FOUND
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.
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.

Generic422:
RetrieveQosProfilesUnprocessable422:
description: Unprocessable Content
headers:
x-correlator:
Expand All @@ -626,26 +535,11 @@ components:
- UNNECESSARY_IDENTIFIER
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_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.

Generic429:
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic429"
$ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_422_SERVICE_NOT_APPLICABLE"
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"

examples:
LIST_OF_QOS_PROFILES:
Expand Down
2 changes: 1 addition & 1 deletion code/Test_definitions/qos-profiles-getQosProfile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation getQosProfile
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body complies with the OAS schema at "/components/schemas/QosProfile"
And the response body complies with the OAS schema at "#/components/schemas/QosProfile"
And the response property "$.name" value is equal to path param "name"
# TBC: Add additional constraints, such as max* properties must be higher than min* equivalent properties, etc

Expand Down
26 changes: 18 additions & 8 deletions code/Test_definitions/qos-profiles-retrieveQosProfiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "../common/CAMARA_common.yaml#/components/schemas/XCorrelator"
# Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema
And the request body is set by default to a request body compliant with the schema at "/components/schemas/QosProfileDeviceRequest"
And the request body is set by default to a request body compliant with the schema at "#/components/schemas/QosProfileDeviceRequest"

############################ Happy Path Scenarios #############################################

@qos_profiles_retrieveQosProfiles_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid testing device and default request body compliant with the schema
Given a request body compliant with the schema at "/components/schemas/QosProfileDeviceRequest"
Given a request body compliant with the schema at "#/components/schemas/QosProfileDeviceRequest"
When the request "retrieveQosProfiles" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And each item of the response array, if any, complies with the OAS schema at "/components/schemas/QosProfile"
And each item of the response array, if any, complies with the OAS schema at "#/components/schemas/QosProfile"
# TBC: Add additional constraints, such as max* properties must be higher than min* equivalent properties, etc

@qos_profiles_retrieveQosProfiles_02_filter_by_name_only
Expand All @@ -45,9 +45,19 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response array has only one item which complies with the OAS schema at "/components/schemas/QosProfile"
And the response array has only one item which complies with the OAS schema at "#/components/schemas/QosProfile"
And the response property "$[0].name" value is equal to the request body property "$.name"

@qos_profiles_retrieveQosProfiles_02b_filter_by_name_not_found
Scenario: Retrieve QoS profiles by a name that matches no profile
Given the request body property "$.name" is set to a QoS profile name that does not match any existing profile
And the request body properties "$.device" and "$.status" are not included
When the request "retrieveQosProfiles" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body is []

@qos_profiles_retrieveQosProfiles_03_filter_by_status_only
Scenario Outline: Retrieve QoS profiles only by status
Given the request body property "$.status" is set to the value <status>
Expand All @@ -56,7 +66,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And each item of the response array, if any, complies with the OAS schema at "/components/schemas/QosProfile"
And each item of the response array, if any, complies with the OAS schema at "#/components/schemas/QosProfile"
And each item of the response array, if any, has property "$[*].status" equal to <status>

Examples:
Expand All @@ -74,7 +84,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And each item of the response array complies with the OAS schema at "/components/schemas/QosProfile"
And each item of the response array complies with the OAS schema at "#/components/schemas/QosProfile"
And the restricted QoS Profiles are returned in the response

@qos_profiles_retrieveQosProfiles_05_not_return_restricted_profiles
Expand All @@ -86,7 +96,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
And each item of the response array complies with the OAS schema at "/components/schemas/QosProfile"
And each item of the response array complies with the OAS schema at "#/components/schemas/QosProfile"
And no restricted QoS Profile is included in the response

@qos_profiles_retrieveQosProfiles_06_device_qos_profiles_not_found
Expand Down Expand Up @@ -188,7 +198,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles

@qos_profiles_retrieveQosProfiles_400.01_schema_not_compliant
Scenario: Invalid Argument. Generic Syntax Exception
Given the request body is set to any value which is not compliant with the schema at "/components/schemas/QosProfileDeviceRequest"
Given the request body is set to any value which is not compliant with the schema at "#/components/schemas/QosProfileDeviceRequest"
When the request "retrieveQosProfiles" is sent
Then the response status code is 400
And the response header "x-correlator" has same value as the request header "x-correlator"
Expand Down
Loading