Publish Service now enforces uniqueness by aefId/apiName instead of global apiName, allowing different AEFs to publish the same apiName while rejecting duplicates from the same AEF on POST, PUT, and PATCH.
### **Testing**
- 2 New tests related with use of same apiName across different AEFs.
### **Documentation**
- 2 New tests added to [OCF Publish API test plan documentation], related with apiName.
## **Release 4.0.0**
### **Visibility Control**
@@ -515,6 +525,7 @@ This Release also includes a Robot Test Suite for all those services and a Postm
[Upgrade Release 17 to 18 Wiki]:https://labs.etsi.org/rep/ocf/community/-/wikis/3GPP-Release-18-upgrade"Upgrade Release 17 to 18 Wiki"
[OCF Publish API test plan documentation]:https://ocf.etsi.org/documentation/latest/testing/testplan/api_publish_service/"OCF Publish API test plan documentation"
[How to Deploy Using Helm]:./gettingstarted/howtodeploy.md"How to Deploy Using Helm"
This test case will check that different AEFs can publish APIs with same apiName.
**Pre-Conditions**:
* CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
**Execution Steps**:
1. Register Provider at CCF and store certificates.
2. Publish Service API
3. Retrieve {apiId} from body and Location header with new resource created from response
**Information of Test**:
1. Perform [invoker onboarding]
2. Perform [Provider Registration] of 2 providers, one with 2 AEFs and other with only 1 AEF.
4. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef_1** from provider 1.
* Use **APF Certificate**
5. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef_2** from provider 1.
* Use **APF Certificate**
6. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef** from provider 2.
* Use **APF Certificate**
7. Retrieve all published APIs by **APF** from provider 1:
* Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis**
* Use **APF_1 Certificate**
8. Request Discover Published APIs:
* Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api_name=service_1**
* Param api-invoker-id is mandatory
* Use **Invoker Certificate**
**Expected Result**:
1. Response to Publish first request must accomplish:
1.**201 Created**
2. Response Body must follow **ServiceAPIDescription** data structure with:
* apiId
3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}**
2. Response to Publish second request must accomplish:
1.**201 Created**
2. Response Body must follow **ServiceAPIDescription** data structure with:
* apiId
3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}**
3. Response to Publish third request must accomplish:
1.**201 Created**
2. Response Body must follow **ServiceAPIDescription** data structure with:
* apiId
3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}**
4. Response to Retrieve all published APIs by **APF** of provider 1:
1.**200 OK**
2. Response body must return an array of **ServiceAPIDescription** data.
3. Array must contain 2 APIs previously published APIs by **APF** of provider 1, one with **AEF_1** and other with **AEF_2**.
5. Response to Discover Request By Invoker:
1.**200 OK** response.
2. Response body must follow **DiscoveredAPIs** data structure:
* Check if DiscoveredAPIs contains 3 APIs published.
---
## Test Case 16: Publish API same apiName and same AEF
This test case will check that different AEFs can publish APIs with same apiName and if we use same AEF then error will be raised.
**Pre-Conditions**:
* CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
**Execution Steps**:
1. Register Provider at CCF and store certificates.
2. Publish Service API
3. Retrieve {apiId} from body and Location header with new resource created from response
**Information of Test**:
1. Perform [invoker onboarding]
2. Perform [Provider Registration] of 2 providers, one with 2 AEFs and other with only 1 AEF.
4. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef_1** from provider 1.
* Use **APF Certificate**
5. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef_1** from provider 1.
* Use **APF Certificate**
6. Publish Service API at CCF:
* Send **POST** to **ccf_publish_url**: **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis**
* body [service api description] with apiName **service_1** and **aef** from provider 2.
* Use **APF Certificate**
7. Request Discover Published APIs:
* Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api_name=service_1**
* Param api-invoker-id is mandatory
* Use **Invoker Certificate**
**Expected Result**:
1. Response to Publish first request must accomplish:
1.**201 Created**
2. Response Body must follow **ServiceAPIDescription** data structure with:
* apiId
3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}**
2. Response to Publish second request must accomplish:
1.**403 Forbidden**
2. Error Response Body must accomplish with **ProblemDetails** data structure with:
* status **403**
* title with message "Forbidden"
* detail with message "Already registered service with same api name and aef id".
* cause with message "Found service with same api name and aef id".
3. Response to Publish third request must accomplish:
1.**201 Created**
2. Response Body must follow **ServiceAPIDescription** data structure with:
* apiId
3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}**
4. Response to Discover Request By Invoker:
1.**200 OK** response.
2. Response body must follow **DiscoveredAPIs** data structure:
* Check if DiscoveredAPIs contains 2 APIs published.
[service api description]:./service_api_description_post_example.json"Service API Description Request"