diff --git a/.github/workflows/api-lint.yml b/.github/workflows/api-lint.yml index 0adb114ef..94af45e78 100644 --- a/.github/workflows/api-lint.yml +++ b/.github/workflows/api-lint.yml @@ -23,7 +23,7 @@ name: api-lint env: API_TYPES: 'OAS' API_DIRECTORIES: 'src/main/resources/swagger.api' - API_EXCLUDES: 'paths,responses,schemas' + API_EXCLUDES: 'paths responses' API_WARNINGS: false on: diff --git a/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml b/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml index a96bd62fb..1e3dedd82 100644 --- a/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml +++ b/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml @@ -1,3 +1,4 @@ +example: - resourceName: instance type: CREATE tenant: diku diff --git a/src/main/resources/swagger.api/examples/request/indexRequestBody.yaml b/src/main/resources/swagger.api/examples/request/indexRequestBody.yaml index 47f626218..6f51bca37 100644 --- a/src/main/resources/swagger.api/examples/request/indexRequestBody.yaml +++ b/src/main/resources/swagger.api/examples/request/indexRequestBody.yaml @@ -1 +1,2 @@ -resourceName: instance +value: + resourceName: instance diff --git a/src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml b/src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml index 98b3def86..b38febc0c 100644 --- a/src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml +++ b/src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml @@ -1 +1,3 @@ -query: "title=*" +value: + query: "title=*" + entityType: "INSTANCE" diff --git a/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml b/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml index fbdd24f8a..5ba4cbf11 100644 --- a/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml +++ b/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml @@ -1 +1,2 @@ -status: success +value: + status: success diff --git a/src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml b/src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml index bacbc6a63..3cc23d549 100644 --- a/src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml +++ b/src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml @@ -1,4 +1,6 @@ -id: "eea1432c-beb8-4f4f-b96a-f8de977f1106" -query: "title=*" -status: "completed" -createdDate: "1974-12-03T00:00:00" +value: + id: 'eea1432c-beb8-4f4f-b96a-f8de977f1106' + query: 'title=*' + status: 'COMPLETED' + entityType: 'INSTANCE' + createdDate: '1974-12-03T00:00:00' diff --git a/src/main/resources/swagger.api/mod-search.yaml b/src/main/resources/swagger.api/mod-search.yaml index 1626e0c7a..9b687fa31 100644 --- a/src/main/resources/swagger.api/mod-search.yaml +++ b/src/main/resources/swagger.api/mod-search.yaml @@ -87,6 +87,18 @@ paths: $ref: 'paths/browse-config/browse-type-browse-option-id.yaml' components: + schemas: + sortOrder: + $ref: 'schemas/entity/sortOrder.yaml' + browseType: + $ref: 'schemas/entity/browseType.yaml' + recordType: + $ref: 'schemas/entity/recordType.yaml' + browseOptionType: + $ref: 'schemas/entity/browseOptionType.yaml' + callNumberType: + $ref: 'schemas/entity/callNumberType.yaml' + responses: unprocessableEntityResponse: $ref: 'responses/unprocessableEntityResponse.yaml' diff --git a/src/main/resources/swagger.api/parameters/record-type.yaml b/src/main/resources/swagger.api/parameters/record-type.yaml new file mode 100644 index 000000000..cbbfdb569 --- /dev/null +++ b/src/main/resources/swagger.api/parameters/record-type.yaml @@ -0,0 +1,5 @@ +name: recordType +required: true +in: path +schema: + $ref: '../schemas/entity/recordType.yaml' diff --git a/src/main/resources/swagger.api/parameters/sort-order-param.yaml b/src/main/resources/swagger.api/parameters/sort-order-param.yaml index 7de14dd38..946231a1d 100644 --- a/src/main/resources/swagger.api/parameters/sort-order-param.yaml +++ b/src/main/resources/swagger.api/parameters/sort-order-param.yaml @@ -1,6 +1,6 @@ in: query name: sortOrder -description: Defines sorting order +description: 'Defines sorting order' required: false schema: $ref: '../schemas/entity/sortOrder.yaml' diff --git a/src/main/resources/swagger.api/paths/browse-call-numbers/browse-call-numbers-instances.yaml b/src/main/resources/swagger.api/paths/browse-call-numbers/browse-call-numbers-instances.yaml index 0729d4fb5..ea652bf15 100644 --- a/src/main/resources/swagger.api/paths/browse-call-numbers/browse-call-numbers-instances.yaml +++ b/src/main/resources/swagger.api/paths/browse-call-numbers/browse-call-numbers-instances.yaml @@ -14,8 +14,10 @@ get: name: callNumberType description: Type of call number required: false - schema: - $ref: '../../schemas/entity/callNumberType.yaml' + content: + application/json: + schema: + $ref: '../../schemas/entity/callNumberType.yaml' responses: '200': description: 'Search result for browsing by call number' diff --git a/src/main/resources/swagger.api/paths/search-facets/search-record-type-facets.yaml b/src/main/resources/swagger.api/paths/search-facets/search-record-type-facets.yaml index 4f4525e37..1aa604634 100644 --- a/src/main/resources/swagger.api/paths/search-facets/search-record-type-facets.yaml +++ b/src/main/resources/swagger.api/paths/search-facets/search-record-type-facets.yaml @@ -4,11 +4,7 @@ get: tags: - facets parameters: - - name: recordType - required: true - in: path - schema: - $ref: '../../schemas/entity/RecordType.yaml' + - $ref: '../../parameters/record-type.yaml' - $ref: '../../parameters/cql-query.yaml' - $ref: '../../parameters/facet-param.yaml' - $ref: '../../parameters/x-okapi-tenant-header.yaml' diff --git a/src/main/resources/swagger.api/paths/search-index/search-index-indices.yaml b/src/main/resources/swagger.api/paths/search-index/search-index-indices.yaml index 9b3f87bc6..da52e75fc 100644 --- a/src/main/resources/swagger.api/paths/search-index/search-index-indices.yaml +++ b/src/main/resources/swagger.api/paths/search-index/search-index-indices.yaml @@ -8,8 +8,9 @@ post: requestBody: content: application/json: - example: - $ref: '../../examples/request/indexRequestBody.yaml' + examples: + objectExample: + $ref: '../../examples/request/indexRequestBody.yaml' schema: $ref: '../../schemas/request/createIndexRequest.yaml' responses: diff --git a/src/main/resources/swagger.api/paths/search-index/search-index-records.yaml b/src/main/resources/swagger.api/paths/search-index/search-index-records.yaml index b4d091677..1680b53cc 100644 --- a/src/main/resources/swagger.api/paths/search-index/search-index-records.yaml +++ b/src/main/resources/swagger.api/paths/search-index/search-index-records.yaml @@ -7,7 +7,7 @@ post: content: application/json: example: - $ref: '../../examples/request/indexRecordRequestBody.yaml' + - $ref: '../../examples/request/indexRecordRequestBody.yaml' schema: $ref: '../../schemas/request/indexRecordRequest.yaml' responses: @@ -15,8 +15,9 @@ post: description: Response with created indices and status (error message will be present if operation failed) content: application/json: - example: - $ref: '../../examples/response/indexRecordResponse.yaml' + examples: + indexRecordResponse: + $ref: '../../examples/response/indexRecordResponse.yaml' schema: $ref: '../../schemas/response/folioIndexOperationResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id.yaml b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id.yaml index 402880dd9..57a372133 100644 --- a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id.yaml +++ b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id.yaml @@ -11,8 +11,9 @@ get: description: 'Job for the stream of resource ids' content: application/json: - example: - $ref: '../../examples/response/streamIdsJobResponse.yaml' + examples: + streamIdsJobResponse: + $ref: '../../examples/response/streamIdsJobResponse.yaml' schema: $ref: '../../schemas/entity/resourceIdsJob.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs.yaml b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs.yaml index e378ce90d..145828d7f 100644 --- a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs.yaml +++ b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs.yaml @@ -8,8 +8,9 @@ post: requestBody: content: application/json: - example: - $ref: '../../examples/request/streamIdsJobRequest.yaml' + examples: + streamIdsJobRequest: + $ref: '../../examples/request/streamIdsJobRequest.yaml' schema: $ref: '../../schemas/entity/resourceIdsJob.yaml' responses: @@ -17,8 +18,9 @@ post: description: 'Job for the stream of resource ids' content: application/json: - example: - $ref: '../../examples/response/streamIdsJobResponse.yaml' + examples: + streamIdsJobResponse: + $ref: '../../examples/response/streamIdsJobResponse.yaml' schema: $ref: '../../schemas/entity/resourceIdsJob.yaml' '400': diff --git a/src/main/resources/swagger.api/schemas/entity/RecordType.yaml b/src/main/resources/swagger.api/schemas/entity/recordType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/entity/RecordType.yaml rename to src/main/resources/swagger.api/schemas/entity/recordType.yaml