diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java index 67411f774d..bf77e72cd4 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java @@ -238,13 +238,13 @@ public Response isDomainExist(@ApiParam(value = "tenant domain",required=true) @ }, tags={ "Tenants", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = TenantsListResponse.class), + @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), @ApiResponse(code = 404, message = "The specified resource is not found", response = Error.class), - @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class), - @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) + @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class) }) - public Response retrieveTenants( @Valid @Min(0)@ApiParam(value = "Maximum number of records to return.") @QueryParam("limit") Integer limit, @Valid @Min(0)@ApiParam(value = "Number of records to skip for pagination.") @QueryParam("offset") Integer offset, @Valid@ApiParam(value = "Define the order in which the retrieved tenants should be sorted.", allowableValues="asc, desc") @QueryParam("sortOrder") String sortOrder, @Valid@ApiParam(value = "Attribute by which the retrieved records should be sorted. Currently sorting through _domainName_ only supported.") @QueryParam("sortBy") String sortBy, @Valid@ApiParam(value = "Condition to filter the retrival of records. Supports 'sw', 'co', 'ew' and 'eq' operations and also complex queries with 'and' operations. E.g. /tenants?filter=domain+sw+\"wso2\". _This option is not yet supported._ ") @QueryParam("filter") String filter) { + public Response retrieveTenants( @Valid @Min(0)@ApiParam(value = "Maximum number of records to return.") @QueryParam("limit") Integer limit, @Valid @Min(0)@ApiParam(value = "Number of records to skip for pagination.") @QueryParam("offset") Integer offset, @Valid@ApiParam(value = "Define the order in which the retrieved tenants should be sorted.", allowableValues="asc, desc") @QueryParam("sortOrder") String sortOrder, @Valid@ApiParam(value = "Attribute by which the retrieved records should be sorted. Currently sorting through domainName only supported.") @QueryParam("sortBy") String sortBy, @Valid@ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. Currently, filtering is supported only by the domainName. E.g. /tenants?filter=domainName+sw+wso2. ") @QueryParam("filter") String filter) { return delegate.retrieveTenants(limit, offset, sortOrder, sortBy, filter ); } diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java index 23f98cdeb6..37c5ebcb44 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java @@ -119,7 +119,6 @@ public String addTenant(TenantModel tenantModel) { public TenantsListResponse listTenants(Integer limit, Integer offset, String sortOrder, String sortBy, String filter) { - handleNotImplementedCapabilities(filter); TenantMgtService tenantMgtService = TenantManagementServiceHolder.getTenantMgtService(); try { @@ -605,26 +604,6 @@ private static String includeData(TenantManagementConstants.ErrorMessage error, return message; } - /** - * Return Not Implemented error response for tenant List filtering which are not yet supported by the server. - * - * @param filter Filter string. - */ - private void handleNotImplementedCapabilities(String filter) { - - TenantManagementConstants.ErrorMessage errorEnum = null; - - if (filter != null) { - errorEnum = TenantManagementConstants.ErrorMessage.ERROR_CODE_FILTER_NOT_IMPLEMENTED; - } - - if (errorEnum != null) { - ErrorResponse errorResponse = getErrorBuilder(errorEnum, null).build(log, errorEnum.getDescription()); - Response.Status status = Response.Status.NOT_IMPLEMENTED; - throw new APIError(status, errorResponse); - } - } - public String addTenant(ChannelVerifiedTenantModel channelVerifiedTenantModel) { String resourceId; TenantMgtService tenantMgtService = TenantManagementServiceHolder.getTenantMgtService(); diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml index 42e23745c8..de10bebe24 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml @@ -43,6 +43,8 @@ paths: 'application/json': schema: $ref: '#/components/schemas/TenantsListResponse' + '400': + $ref: '#/components/responses/InvalidInput' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -51,12 +53,6 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' - '501': - description: Not Implemented - content: - application/json: - schema: - $ref: '#/components/schemas/Error' post: tags: - Tenants @@ -488,7 +484,7 @@ components: name: sortBy required: false description: >- - Attribute by which the retrieved records should be sorted. Currently sorting through _domainName_ only + Attribute by which the retrieved records should be sorted. Currently sorting through domainName only supported. schema: type: string @@ -497,10 +493,9 @@ components: name: filter required: false description: > - Condition to filter the retrival of records. Supports 'sw', 'co', 'ew' - and 'eq' operations and also complex queries with 'and' operations. E.g. - /tenants?filter=domain+sw+"wso2". _This - option is not yet supported._ + Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. + Currently, filtering is supported only by the domainName. + E.g. /tenants?filter=domainName+sw+wso2. schema: type: string additionalClaimsQueryParam: