From f18fc704b27bb2e03f9ef36df18b4c04a54edd76 Mon Sep 17 00:00:00 2001 From: GeloPakDev1 Date: Tue, 26 Mar 2024 14:24:10 +0500 Subject: [PATCH] style(api-docs): clean up api documentation. Previously, it was not possible to check request/response bodies samples in API documentation. This commit solves this error by refactoring the API documentation by using yaml for all api schemas/samples and decomposition of the open-api.yaml file. - decompose the mod-search.yaml file. - move all the paths into separate yaml files with corresponded folders inside paths folder. - move all the parameters into separate yaml files inside the parameters folder. - create yaml versions for all the examples. - create yaml versions for all the schemas. - delete example files with sample extension. - delete schemas files with json extension. Closes MSEARCH-546. --- .../org/folio/search/model/ResourceId.java | 20 + .../org/folio/search/model/ResourceIds.java | 27 + .../examples/HoldingIdsResult.sample | 14 - .../swagger.api/examples/IdsTextResult.sample | 3 - .../examples/InstanceIdsResult.sample | 14 - .../examples/browseContributorsResult.sample | 55 - .../swagger.api/examples/facetResult.sample | 18 - .../examples/indexCreationError.sample | 10 - .../examples/indexNotFoundError.sample | 10 - .../examples/indexRecordRequestBody.sample | 56 - .../examples/indexRecordResponse.sample | 3 - .../examples/indexRequestBody.sample | 3 - .../examples/reindexRequest.sample | 3 - .../{ => request}/indexRecordRequestBody.yaml | 0 .../{ => request}/indexRequestBody.yaml | 0 .../{ => request}/reindexRequest.yaml | 0 .../{ => request}/streamIdsJobRequest.yaml | 0 .../examples/resourceIdsResult.sample | 14 - .../{ => response}/indexRecordResponse.yaml | 0 .../{ => response}/streamIdsJobResponse.yaml | 0 .../examples/{ => response}/unknownError.yaml | 0 .../validationErrorResponse.yaml | 0 .../{ => result}/HoldingIdsResult.yaml | 0 .../examples/{ => result}/IdsTextResult.yaml | 0 .../{ => result}/InstanceIdsResult.yaml | 0 .../browseContributorsResult.yaml | 0 .../examples/{ => result}/facetResult.yaml | 0 .../{ => result}/resourceIdsResult.yaml | 0 .../examples/{ => result}/searchResult.yaml | 0 .../swagger.api/examples/searchResult.sample | 20 - .../examples/streamIdsJobRequest.sample | 3 - .../examples/streamIdsJobResponse.sample | 6 - .../swagger.api/examples/unknownError.sample | 10 - .../examples/validationErrorResponse.sample | 16 - .../resources/swagger.api/mod-search-2.yaml | 252 ---- .../resources/swagger.api/mod-search.yaml | 1054 +---------------- .../parameters/browse-option-id.yaml | 2 +- .../swagger.api/parameters/browse-type.yaml | 4 +- .../parameters/sort-order-param.yaml | 2 +- .../browse-authorities.yaml | 2 +- .../browse-call-numbers-instances.yaml | 4 +- .../browse-option-id-instances.yaml | 2 +- .../browse-type-browse-option-id.yaml | 2 +- .../paths/browse-config/browse-type.yaml | 2 +- .../browse-contributors-instances.yaml | 4 +- .../browse-subjects-instances.yaml | 2 +- .../search-authorities.yaml | 2 +- .../search-config-features-feature-id.yaml | 4 +- .../search-config/search-config-features.yaml | 6 +- .../search-config-languages-code.yaml | 4 +- .../search-config-languages.yaml | 6 +- .../search-consortium-holdings.yaml | 2 +- .../search-consortium-items.yaml | 2 +- .../search-record-type-facets.yaml | 6 +- .../search-holdings/search-holdings-ids.yaml | 4 +- .../search-index/search-index-indices.yaml | 4 +- .../search-index-inventory-reindex.yaml | 4 +- .../search-index/search-index-records.yaml | 6 +- .../search-index/search-index-settings.yaml | 2 +- .../search-instances-ids.yaml | 4 +- .../search-instances/search-instances.yaml | 2 +- .../search-resources-jobs-job-id-ids.yaml | 2 +- .../search-resources-jobs-job-id.yaml | 4 +- .../search-resources-jobs.yaml | 8 +- .../responses/badRequestResponse.yaml | 4 +- .../internalServerErrorResponse.yaml | 2 +- .../unprocessableEntityResponse.yaml | 2 +- .../swagger.api/schemas/RecordType.yaml | 3 - .../swagger.api/schemas/alternativeTitle.json | 19 - .../swagger.api/schemas/authority.json | 273 ----- .../swagger.api/schemas/browseType.yaml | 3 + .../swagger.api/schemas/circulationNote.json | 16 - .../swagger.api/schemas/contributor.json | 31 - .../swagger.api/schemas/electronicAccess.json | 23 - .../schemas/entity/RecordType.yaml | 2 + .../{ => entity}/alternativeTitle.yaml | 0 .../schemas/{ => entity}/authority.yaml | 0 .../schemas/{ => entity}/browseConfig.yaml | 4 +- .../{ => entity}/browseConfigCollection.yaml | 2 +- .../{ => entity}/browseOptionType.yaml | 0 .../schemas/{ => entity}/callNumberType.yaml | 0 .../schemas/entity/circulationNote.yaml | 10 + .../{ => entity}/consortiumHolding.yaml | 0 .../consortiumHoldingCollection.yaml | 0 .../schemas/{ => entity}/consortiumItem.yaml | 0 .../consortiumItemCollection.yaml | 0 .../schemas/{ => entity}/contributor.yaml | 0 .../{ => entity}/electronicAccess.yaml | 0 .../schemas/{ => entity}/error.yaml | 1 - .../schemas/{response => entity}/facet.yaml | 0 .../{response => entity}/facetItem.yaml | 0 .../{response => entity}/facetItems.yaml | 0 .../schemas/{ => entity}/featureConfig.yaml | 0 .../schemas/{ => entity}/featureConfigs.yaml | 0 .../swagger.api/schemas/entity/holding.yaml | 70 ++ .../schemas/{ => entity}/identifiers.yaml | 0 .../{ => entity}/indexDynamicSettings.yaml | 0 .../schemas/{ => entity}/indexSettings.yaml | 0 .../schemas/{ => entity}/instance.yaml | 8 +- .../swagger.api/schemas/entity/item.yaml | 100 ++ .../schemas/{ => entity}/languageConfig.yaml | 0 .../schemas/{ => entity}/languageConfigs.yaml | 0 .../schemas/{ => entity}/metadata.yaml | 0 .../swagger.api/schemas/entity/note.yaml | 10 + .../schemas/{ => entity}/parameter.yaml | 0 .../schemas/{ => entity}/parameters.yaml | 0 .../schemas/{ => entity}/reindexJob.yaml | 0 .../resouceIds.yaml} | 0 .../resourceDeleteEventSubType.yaml | 0 .../schemas/{ => entity}/resourceEvent.yaml | 0 .../{ => entity}/resourceEventType.yaml | 0 .../{response => entity}/resourceId.yaml | 0 .../schemas/{ => entity}/resourceIdsJob.yaml | 0 .../schemas/{ => entity}/seriesItem.yaml | 0 .../shelvingOrderAlgorithmType.yaml | 0 .../swagger.api/schemas/entity/sortOrder.yaml | 4 + .../schemas/{ => entity}/subject.yaml | 0 .../schemas/{ => entity}/tags.yaml | 0 .../{ => entity}/tenantConfiguredFeature.yaml | 0 .../resources/swagger.api/schemas/error.json | 24 - .../resources/swagger.api/schemas/errors.json | 20 - .../swagger.api/schemas/featureConfig.json | 18 - .../swagger.api/schemas/featureConfigs.json | 20 - .../schemas/folioCreateIndexResponse.json | 26 - .../schemas/folioIndexOperationResponse.json | 17 - .../schemas/folioIndexOperationResponse.yaml | 13 - .../swagger.api/schemas/holding.json | 95 -- .../swagger.api/schemas/identifiers.json | 15 - .../schemas/indexDynamicSettings.json | 19 - .../swagger.api/schemas/indexSettings.json | 25 - .../swagger.api/schemas/instance.json | 202 ---- .../resources/swagger.api/schemas/item.json | 138 --- .../swagger.api/schemas/languageConfig.json | 19 - .../swagger.api/schemas/languageConfigs.json | 25 - .../swagger.api/schemas/metadata.json | 31 - .../resources/swagger.api/schemas/note.json | 16 - .../swagger.api/schemas/parameter.json | 15 - .../swagger.api/schemas/parameters.json | 9 - .../swagger.api/schemas/reindexJob.json | 19 - .../schemas/request/createIndexRequest.json | 13 - .../schemas/request/indexRecordRequest.yaml | 3 +- .../schemas/request/reindexRequest.json | 21 - .../schemas/request/reindexRequest.yaml | 2 +- .../updateIndexDynamicSettingsRequest.json | 16 - .../updateIndexDynamicSettingsRequest.yaml | 2 +- .../request/updateMappingsRequest.json | 13 - .../schemas/resourceDeleteEventSubType.json | 6 - .../swagger.api/schemas/resourceEvent.json | 35 - .../schemas/resourceEventType.json | 6 - .../swagger.api/schemas/resourceIdsJob.json | 43 - .../schemas/response/authorityBrowseItem.json | 19 - .../schemas/response/authorityBrowseItem.yaml | 2 +- .../response/authorityBrowseResult.json | 26 - .../response/authorityBrowseResult.yaml | 2 +- .../response/authoritySearchResult.json | 18 - .../response/authoritySearchResult.yaml | 2 +- .../response/callNumberBrowseItem.json | 27 - .../response/callNumberBrowseItem.yaml | 2 +- .../response/callNumberBrowseResult.json | 26 - .../classificationNumberBrowseItem.json | 23 - .../classificationNumberBrowseResult.json | 26 - ...sult.yaml => contributorBrowseResult.yaml} | 2 +- .../errorResponse.yaml} | 2 +- .../swagger.api/schemas/response/facet.json | 15 - .../schemas/response/facetItem.json | 15 - .../schemas/response/facetItems.json | 8 - .../schemas/response/facetResult.json | 18 - .../schemas/{ => response}/facetResult.yaml | 2 +- .../folioCreateIndexResponse.yaml | 0 .../instanceContributorBrowseItem.json | 35 - .../instanceContributorBrowseResult.json | 26 - .../response/instanceSearchResult.json | 18 - .../response/instanceSearchResult.yaml | 2 +- .../schemas/response/resourceId.json | 11 - .../schemas/response/resourceIds.json | 18 - .../schemas/response/subjectBrowseItem.json | 23 - .../schemas/response/subjectBrowseResult.json | 26 - .../swagger.api/schemas/seriesItem.json | 15 - .../swagger.api/schemas/sortOrder.yaml | 5 - .../swagger.api/schemas/subject.json | 15 - .../resources/swagger.api/schemas/tags.json | 17 - .../schemas/tenantConfiguredFeature.json | 11 - .../BrowseContributorConsortiumIT.java | 10 +- .../controller/BrowseContributorIT.java | 44 +- .../ResourcesIdsControllerTest.java | 4 +- .../search/service/ResourceIdServiceTest.java | 4 +- 186 files changed, 410 insertions(+), 3331 deletions(-) create mode 100644 src/main/java/org/folio/search/model/ResourceId.java create mode 100644 src/main/java/org/folio/search/model/ResourceIds.java delete mode 100644 src/main/resources/swagger.api/examples/HoldingIdsResult.sample delete mode 100644 src/main/resources/swagger.api/examples/IdsTextResult.sample delete mode 100644 src/main/resources/swagger.api/examples/InstanceIdsResult.sample delete mode 100644 src/main/resources/swagger.api/examples/browseContributorsResult.sample delete mode 100644 src/main/resources/swagger.api/examples/facetResult.sample delete mode 100644 src/main/resources/swagger.api/examples/indexCreationError.sample delete mode 100644 src/main/resources/swagger.api/examples/indexNotFoundError.sample delete mode 100644 src/main/resources/swagger.api/examples/indexRecordRequestBody.sample delete mode 100644 src/main/resources/swagger.api/examples/indexRecordResponse.sample delete mode 100644 src/main/resources/swagger.api/examples/indexRequestBody.sample delete mode 100644 src/main/resources/swagger.api/examples/reindexRequest.sample rename src/main/resources/swagger.api/examples/{ => request}/indexRecordRequestBody.yaml (100%) rename src/main/resources/swagger.api/examples/{ => request}/indexRequestBody.yaml (100%) rename src/main/resources/swagger.api/examples/{ => request}/reindexRequest.yaml (100%) rename src/main/resources/swagger.api/examples/{ => request}/streamIdsJobRequest.yaml (100%) delete mode 100644 src/main/resources/swagger.api/examples/resourceIdsResult.sample rename src/main/resources/swagger.api/examples/{ => response}/indexRecordResponse.yaml (100%) rename src/main/resources/swagger.api/examples/{ => response}/streamIdsJobResponse.yaml (100%) rename src/main/resources/swagger.api/examples/{ => response}/unknownError.yaml (100%) rename src/main/resources/swagger.api/examples/{ => response}/validationErrorResponse.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/HoldingIdsResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/IdsTextResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/InstanceIdsResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/browseContributorsResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/facetResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/resourceIdsResult.yaml (100%) rename src/main/resources/swagger.api/examples/{ => result}/searchResult.yaml (100%) delete mode 100644 src/main/resources/swagger.api/examples/searchResult.sample delete mode 100644 src/main/resources/swagger.api/examples/streamIdsJobRequest.sample delete mode 100644 src/main/resources/swagger.api/examples/streamIdsJobResponse.sample delete mode 100644 src/main/resources/swagger.api/examples/unknownError.sample delete mode 100644 src/main/resources/swagger.api/examples/validationErrorResponse.sample delete mode 100644 src/main/resources/swagger.api/mod-search-2.yaml delete mode 100644 src/main/resources/swagger.api/schemas/RecordType.yaml delete mode 100644 src/main/resources/swagger.api/schemas/alternativeTitle.json delete mode 100644 src/main/resources/swagger.api/schemas/authority.json create mode 100644 src/main/resources/swagger.api/schemas/browseType.yaml delete mode 100644 src/main/resources/swagger.api/schemas/circulationNote.json delete mode 100644 src/main/resources/swagger.api/schemas/contributor.json delete mode 100644 src/main/resources/swagger.api/schemas/electronicAccess.json create mode 100644 src/main/resources/swagger.api/schemas/entity/RecordType.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/alternativeTitle.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/authority.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/browseConfig.yaml (76%) rename src/main/resources/swagger.api/schemas/{ => entity}/browseConfigCollection.yaml (64%) rename src/main/resources/swagger.api/schemas/{ => entity}/browseOptionType.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/callNumberType.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/entity/circulationNote.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/consortiumHolding.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/consortiumHoldingCollection.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/consortiumItem.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/consortiumItemCollection.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/contributor.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/electronicAccess.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/error.yaml (87%) rename src/main/resources/swagger.api/schemas/{response => entity}/facet.yaml (100%) rename src/main/resources/swagger.api/schemas/{response => entity}/facetItem.yaml (100%) rename src/main/resources/swagger.api/schemas/{response => entity}/facetItems.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/featureConfig.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/featureConfigs.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/entity/holding.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/identifiers.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/indexDynamicSettings.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/indexSettings.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/instance.yaml (97%) create mode 100644 src/main/resources/swagger.api/schemas/entity/item.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/languageConfig.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/languageConfigs.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/metadata.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/entity/note.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/parameter.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/parameters.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/reindexJob.yaml (100%) rename src/main/resources/swagger.api/schemas/{response/resourceIds.yaml => entity/resouceIds.yaml} (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/resourceDeleteEventSubType.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/resourceEvent.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/resourceEventType.yaml (100%) rename src/main/resources/swagger.api/schemas/{response => entity}/resourceId.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/resourceIdsJob.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/seriesItem.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/shelvingOrderAlgorithmType.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/entity/sortOrder.yaml rename src/main/resources/swagger.api/schemas/{ => entity}/subject.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/tags.yaml (100%) rename src/main/resources/swagger.api/schemas/{ => entity}/tenantConfiguredFeature.yaml (100%) delete mode 100644 src/main/resources/swagger.api/schemas/error.json delete mode 100644 src/main/resources/swagger.api/schemas/errors.json delete mode 100644 src/main/resources/swagger.api/schemas/featureConfig.json delete mode 100644 src/main/resources/swagger.api/schemas/featureConfigs.json delete mode 100644 src/main/resources/swagger.api/schemas/folioCreateIndexResponse.json delete mode 100644 src/main/resources/swagger.api/schemas/folioIndexOperationResponse.json delete mode 100644 src/main/resources/swagger.api/schemas/folioIndexOperationResponse.yaml delete mode 100644 src/main/resources/swagger.api/schemas/holding.json delete mode 100644 src/main/resources/swagger.api/schemas/identifiers.json delete mode 100644 src/main/resources/swagger.api/schemas/indexDynamicSettings.json delete mode 100644 src/main/resources/swagger.api/schemas/indexSettings.json delete mode 100644 src/main/resources/swagger.api/schemas/instance.json delete mode 100644 src/main/resources/swagger.api/schemas/item.json delete mode 100644 src/main/resources/swagger.api/schemas/languageConfig.json delete mode 100644 src/main/resources/swagger.api/schemas/languageConfigs.json delete mode 100644 src/main/resources/swagger.api/schemas/metadata.json delete mode 100644 src/main/resources/swagger.api/schemas/note.json delete mode 100644 src/main/resources/swagger.api/schemas/parameter.json delete mode 100644 src/main/resources/swagger.api/schemas/parameters.json delete mode 100644 src/main/resources/swagger.api/schemas/reindexJob.json delete mode 100644 src/main/resources/swagger.api/schemas/request/createIndexRequest.json delete mode 100644 src/main/resources/swagger.api/schemas/request/reindexRequest.json delete mode 100644 src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.json delete mode 100644 src/main/resources/swagger.api/schemas/request/updateMappingsRequest.json delete mode 100644 src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.json delete mode 100644 src/main/resources/swagger.api/schemas/resourceEvent.json delete mode 100644 src/main/resources/swagger.api/schemas/resourceEventType.json delete mode 100644 src/main/resources/swagger.api/schemas/resourceIdsJob.json delete mode 100644 src/main/resources/swagger.api/schemas/response/authorityBrowseItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/authorityBrowseResult.json delete mode 100644 src/main/resources/swagger.api/schemas/response/authoritySearchResult.json delete mode 100644 src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/callNumberBrowseResult.json delete mode 100644 src/main/resources/swagger.api/schemas/response/classificationNumberBrowseItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/classificationNumberBrowseResult.json rename src/main/resources/swagger.api/schemas/response/{instanceContributorBrowseResult.yaml => contributorBrowseResult.yaml} (89%) rename src/main/resources/swagger.api/schemas/{errors.yaml => response/errorResponse.yaml} (87%) delete mode 100644 src/main/resources/swagger.api/schemas/response/facet.json delete mode 100644 src/main/resources/swagger.api/schemas/response/facetItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/facetItems.json delete mode 100644 src/main/resources/swagger.api/schemas/response/facetResult.json rename src/main/resources/swagger.api/schemas/{ => response}/facetResult.yaml (86%) rename src/main/resources/swagger.api/schemas/{ => response}/folioCreateIndexResponse.yaml (100%) delete mode 100644 src/main/resources/swagger.api/schemas/response/instanceContributorBrowseItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.json delete mode 100644 src/main/resources/swagger.api/schemas/response/instanceSearchResult.json delete mode 100644 src/main/resources/swagger.api/schemas/response/resourceId.json delete mode 100644 src/main/resources/swagger.api/schemas/response/resourceIds.json delete mode 100644 src/main/resources/swagger.api/schemas/response/subjectBrowseItem.json delete mode 100644 src/main/resources/swagger.api/schemas/response/subjectBrowseResult.json delete mode 100644 src/main/resources/swagger.api/schemas/seriesItem.json delete mode 100644 src/main/resources/swagger.api/schemas/sortOrder.yaml delete mode 100644 src/main/resources/swagger.api/schemas/subject.json delete mode 100644 src/main/resources/swagger.api/schemas/tags.json delete mode 100644 src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json diff --git a/src/main/java/org/folio/search/model/ResourceId.java b/src/main/java/org/folio/search/model/ResourceId.java new file mode 100644 index 000000000..4e010aba4 --- /dev/null +++ b/src/main/java/org/folio/search/model/ResourceId.java @@ -0,0 +1,20 @@ +package org.folio.search.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ResourceId { + + private String id; + + public ResourceId id(String id) { + this.id = id; + return this; + } +} diff --git a/src/main/java/org/folio/search/model/ResourceIds.java b/src/main/java/org/folio/search/model/ResourceIds.java new file mode 100644 index 000000000..5607ae79f --- /dev/null +++ b/src/main/java/org/folio/search/model/ResourceIds.java @@ -0,0 +1,27 @@ +package org.folio.search.model; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ResourceIds { + + private Integer totalRecords; + private List ids; + + public ResourceIds totalRecords(Integer totalRecords) { + this.totalRecords = totalRecords; + return this; + } + + public ResourceIds ids(List ids) { + this.ids = ids; + return this; + } +} diff --git a/src/main/resources/swagger.api/examples/HoldingIdsResult.sample b/src/main/resources/swagger.api/examples/HoldingIdsResult.sample deleted file mode 100644 index b0558a1e9..000000000 --- a/src/main/resources/swagger.api/examples/HoldingIdsResult.sample +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ids": [ - { - "id": "dfb3afad-15c8-4243-9df1-81b12ebd6413" - }, - { - "id": "c95c7b5d-1fc2-4615-9c73-7034113d30fd" - }, - { - "id": "2d8abe4b-be87-441c-a163-c3876aa9717b" - } - ], - "totalRecords": 3 -} diff --git a/src/main/resources/swagger.api/examples/IdsTextResult.sample b/src/main/resources/swagger.api/examples/IdsTextResult.sample deleted file mode 100644 index 9156f0a0e..000000000 --- a/src/main/resources/swagger.api/examples/IdsTextResult.sample +++ /dev/null @@ -1,3 +0,0 @@ -5fab345a-30a4-4aee-8667-1e33d4627ce9 -e60063f6-db50-4a2a-93f6-6b27ab0420f2 -e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9 diff --git a/src/main/resources/swagger.api/examples/InstanceIdsResult.sample b/src/main/resources/swagger.api/examples/InstanceIdsResult.sample deleted file mode 100644 index d2711ffb1..000000000 --- a/src/main/resources/swagger.api/examples/InstanceIdsResult.sample +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ids": [ - { - "id": "e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9" - }, - { - "id": "e60063f6-db50-4a2a-93f6-6b27ab0420f2" - }, - { - "id": "5fab345a-30a4-4aee-8667-1e33d4627ce9" - } - ], - "totalRecords": 3 -} diff --git a/src/main/resources/swagger.api/examples/browseContributorsResult.sample b/src/main/resources/swagger.api/examples/browseContributorsResult.sample deleted file mode 100644 index e3c335fd4..000000000 --- a/src/main/resources/swagger.api/examples/browseContributorsResult.sample +++ /dev/null @@ -1,55 +0,0 @@ -{ - "totalRecords":5, - "next":"Paul McCartney", - "items": [ - { - "name": "Anthony Kiedis", - "contributorTypeId": [ - "2a165833-1673-493f-934b-f3d3c8fcb299" - ], - "contributorNameTypeId": "e2ef4075-310a-4447-a231-712bf10cc985", - "authorityId": "7ff32633-cc49-4332-870a-b05e329d2a2d", - "isAnchor": false, - "totalRecords":1 - }, - { - "name": "Bon Jovi", - "contributorTypeId": [ - "2a165833-1673-493f-934b-f3d3c8fcb299", - "3ae36e29-e38f-457c-8fcf-1974a6cb63d3", - "653ffe66-aa3f-4f1c-a090-c42c4011ef40" - ], - "contributorNameTypeId": "e2ef4075-310a-4447-a231-712bf10cc985", - "authorityId": "0a4c6d10-2161-4f64-aace-9e919489b6c9", - "isAnchor": false, - "totalRecords": 2 - }, - { - "name": "John Lennon", - "isAnchor": true, - "totalRecords": 0 - }, - { - "name": "Klaus Meine", - "contributorTypeId": [ - "2a165833-1673-493f-934b-f3d3c8fcb299", - "3ae36e29-e38f-457c-8fcf-1974a6cb63d3" - ], - "contributorNameTypeId": "e2ef4075-310a-4447-a231-712bf10cc985", - "authorityId": "7ff32633-cc49-4332-870a-b05e329d2a2d", - "isAnchor": false, - "totalRecords": 2 - }, - { - "name": "Paul McCartney", - "contributorTypeId": [ - "2a165833-1673-493f-934b-f3d3c8fcb299", - "3ae36e29-e38f-457c-8fcf-1974a6cb63d3" - ], - "contributorNameTypeId": "e2ef4075-310a-4447-a231-712bf10cc985", - "authorityId": "0a4c6d10-2161-4f64-aace-9e919489b6c9", - "isAnchor": false, - "totalRecords": 2 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/facetResult.sample b/src/main/resources/swagger.api/examples/facetResult.sample deleted file mode 100644 index ca058d428..000000000 --- a/src/main/resources/swagger.api/examples/facetResult.sample +++ /dev/null @@ -1,18 +0,0 @@ -{ - "facets": { - "source": { - "values": [ - { - "id": "MARC", - "totalRecords": 20 - }, - { - "id": "FOLIO", - "totalRecords": 10 - } - ], - "totalRecords": 2 - } - }, - "totalRecords": 1 -} diff --git a/src/main/resources/swagger.api/examples/indexCreationError.sample b/src/main/resources/swagger.api/examples/indexCreationError.sample deleted file mode 100644 index c76141bb9..000000000 --- a/src/main/resources/swagger.api/examples/indexCreationError.sample +++ /dev/null @@ -1,10 +0,0 @@ -{ - "errors": [ - { - "message": "Index already exists: instance_test-tenant", - "type": "ElasticsearchException", - "code": "elasticsearch_error" - } - ], - "total_records": 1 -} diff --git a/src/main/resources/swagger.api/examples/indexNotFoundError.sample b/src/main/resources/swagger.api/examples/indexNotFoundError.sample deleted file mode 100644 index 834c87a70..000000000 --- a/src/main/resources/swagger.api/examples/indexNotFoundError.sample +++ /dev/null @@ -1,10 +0,0 @@ -{ - "errors": [ - { - "message": "Index not found: instance_test-tenant", - "type": "ElasticsearchException", - "code": "elasticsearch_error" - } - ], - "total_records": 1 -} diff --git a/src/main/resources/swagger.api/examples/indexRecordRequestBody.sample b/src/main/resources/swagger.api/examples/indexRecordRequestBody.sample deleted file mode 100644 index fc913d5bf..000000000 --- a/src/main/resources/swagger.api/examples/indexRecordRequestBody.sample +++ /dev/null @@ -1,56 +0,0 @@ -[ - { - "resourceName": "instance", - "type": "CREATE", - "tenant": "diku", - "new": { - "id": "83249565-16a8-4687-9061-fd1de43d7f34", - "hrid": "in869", - "title": "Kunstschätze aus badischen Schlössern :Meersburg, Rastatt, Favorite, Bruchsal, Heidelberg, Schwetzingen : 9. Juli bis 12. Oktober 1968, Ausstellung im Gartensaal des Karlsruher Schlosses /Badisches Landesmuseum Karlsruhe ; [Gesamtgestaltung und Redaktion, Ernst Petrasch].", - "source": "MARC", - "editions": [ "2. Aufl." ], - "metadata": { - "createdDate": "1974-12-03T00:00:00", - "updatedDate": "2018-10-15T13:25:11Z" - }, - "statusId": "7cc3837e-c4f1-4584-a3ae-b0c0bfce4bb2", - "subjects": [ - "Art--Germany--Exhibitions.", "Castles--Germany--Exhibitions.", "Art, Modern.", "Exhibition catalogs." - ], - "languages": [ "ger" ], - "indexTitle": "Kunstschätze aus badischen Schlössern :Meersburg, Rastatt, Favorite, Bruchsal, Heidelberg, Schwetzingen : 9. Juli bis 12. Oktober 1968, Ausstellung im Gartensaal des Karlsruher Schlosses /Badisches Landesmuseum Karlsruhe ; [Gesamtgestaltung und Redaktion, Ernst Petrasch].", - "identifiers": [ - { - "value": "(ICU)BID10243", - "identifierTypeId": "2baf4cec-6abf-438b-abd0-a6c512c3c173" - }, { - "value": "(OCoLC)26620653", - "identifierTypeId": "01ca9cda-7027-4d64-abed-9e3c4943daf2" - } - ], - "publication": [ - { - "place": "Karlsruhe :", - "publisher": "The Museum", - "dateOfPublication": "1968" - } - ], - "contributors": [ - { - "name": "Badisches Landesmuseum Karlsruhe", - "primary": true, - "contributorNameTypeId": "2b4007a7-2d96-4262-a360-c9f760e355c3" - }, { - "name": "Petrasch, Ernst", - "primary": false, - "contributorNameTypeId": "35b01201-597f-4938-a0d1-110245ba9d67" - } - ], - "instanceTypeId": "1c43b4c1-b138-4386-a91d-0d305e4ddf23", - "modeOfIssuanceId": "7b143a6c-84e8-4168-94b1-24220a3d14cc", - "discoverySuppress": false, - "statusUpdatedDate": "2019-12-18T20:46:50Z", - "physicalDescriptions": [ "46 p. : ill. ; 21 cm." ] - } - } -] diff --git a/src/main/resources/swagger.api/examples/indexRecordResponse.sample b/src/main/resources/swagger.api/examples/indexRecordResponse.sample deleted file mode 100644 index ba179c300..000000000 --- a/src/main/resources/swagger.api/examples/indexRecordResponse.sample +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status": "success" -} diff --git a/src/main/resources/swagger.api/examples/indexRequestBody.sample b/src/main/resources/swagger.api/examples/indexRequestBody.sample deleted file mode 100644 index 421c8d9a4..000000000 --- a/src/main/resources/swagger.api/examples/indexRequestBody.sample +++ /dev/null @@ -1,3 +0,0 @@ -{ - "resourceName": "instance" -} diff --git a/src/main/resources/swagger.api/examples/reindexRequest.sample b/src/main/resources/swagger.api/examples/reindexRequest.sample deleted file mode 100644 index 0b61029e7..000000000 --- a/src/main/resources/swagger.api/examples/reindexRequest.sample +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recreateIndex": true -} diff --git a/src/main/resources/swagger.api/examples/indexRecordRequestBody.yaml b/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/indexRecordRequestBody.yaml rename to src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml diff --git a/src/main/resources/swagger.api/examples/indexRequestBody.yaml b/src/main/resources/swagger.api/examples/request/indexRequestBody.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/indexRequestBody.yaml rename to src/main/resources/swagger.api/examples/request/indexRequestBody.yaml diff --git a/src/main/resources/swagger.api/examples/reindexRequest.yaml b/src/main/resources/swagger.api/examples/request/reindexRequest.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/reindexRequest.yaml rename to src/main/resources/swagger.api/examples/request/reindexRequest.yaml diff --git a/src/main/resources/swagger.api/examples/streamIdsJobRequest.yaml b/src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/streamIdsJobRequest.yaml rename to src/main/resources/swagger.api/examples/request/streamIdsJobRequest.yaml diff --git a/src/main/resources/swagger.api/examples/resourceIdsResult.sample b/src/main/resources/swagger.api/examples/resourceIdsResult.sample deleted file mode 100644 index d2711ffb1..000000000 --- a/src/main/resources/swagger.api/examples/resourceIdsResult.sample +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ids": [ - { - "id": "e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9" - }, - { - "id": "e60063f6-db50-4a2a-93f6-6b27ab0420f2" - }, - { - "id": "5fab345a-30a4-4aee-8667-1e33d4627ce9" - } - ], - "totalRecords": 3 -} diff --git a/src/main/resources/swagger.api/examples/indexRecordResponse.yaml b/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/indexRecordResponse.yaml rename to src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml diff --git a/src/main/resources/swagger.api/examples/streamIdsJobResponse.yaml b/src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/streamIdsJobResponse.yaml rename to src/main/resources/swagger.api/examples/response/streamIdsJobResponse.yaml diff --git a/src/main/resources/swagger.api/examples/unknownError.yaml b/src/main/resources/swagger.api/examples/response/unknownError.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/unknownError.yaml rename to src/main/resources/swagger.api/examples/response/unknownError.yaml diff --git a/src/main/resources/swagger.api/examples/validationErrorResponse.yaml b/src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/validationErrorResponse.yaml rename to src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml diff --git a/src/main/resources/swagger.api/examples/HoldingIdsResult.yaml b/src/main/resources/swagger.api/examples/result/HoldingIdsResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/HoldingIdsResult.yaml rename to src/main/resources/swagger.api/examples/result/HoldingIdsResult.yaml diff --git a/src/main/resources/swagger.api/examples/IdsTextResult.yaml b/src/main/resources/swagger.api/examples/result/IdsTextResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/IdsTextResult.yaml rename to src/main/resources/swagger.api/examples/result/IdsTextResult.yaml diff --git a/src/main/resources/swagger.api/examples/InstanceIdsResult.yaml b/src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/InstanceIdsResult.yaml rename to src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml diff --git a/src/main/resources/swagger.api/examples/browseContributorsResult.yaml b/src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/browseContributorsResult.yaml rename to src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml diff --git a/src/main/resources/swagger.api/examples/facetResult.yaml b/src/main/resources/swagger.api/examples/result/facetResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/facetResult.yaml rename to src/main/resources/swagger.api/examples/result/facetResult.yaml diff --git a/src/main/resources/swagger.api/examples/resourceIdsResult.yaml b/src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/resourceIdsResult.yaml rename to src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml diff --git a/src/main/resources/swagger.api/examples/searchResult.yaml b/src/main/resources/swagger.api/examples/result/searchResult.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/searchResult.yaml rename to src/main/resources/swagger.api/examples/result/searchResult.yaml diff --git a/src/main/resources/swagger.api/examples/searchResult.sample b/src/main/resources/swagger.api/examples/searchResult.sample deleted file mode 100644 index f52025fcc..000000000 --- a/src/main/resources/swagger.api/examples/searchResult.sample +++ /dev/null @@ -1,20 +0,0 @@ -{ - "totalRecords": 1, - "instances": [ - { - "id": "d20569a7-9bba-44dd-9ad5-6f8f1d24ee1f", - "title": "Bilingualism:a bibliography of 1000 references with special reference to Wales.", - "contributors": [ - { - "name": "Eichhorst, Georg." - } - ], - "publication": [ - { - "publisher": "Duncker und Humblot", - "dateOfPublication": "1976" - } - ] - } - ] -} diff --git a/src/main/resources/swagger.api/examples/streamIdsJobRequest.sample b/src/main/resources/swagger.api/examples/streamIdsJobRequest.sample deleted file mode 100644 index e9dd4f7d3..000000000 --- a/src/main/resources/swagger.api/examples/streamIdsJobRequest.sample +++ /dev/null @@ -1,3 +0,0 @@ -{ - "query": "title=*" -} diff --git a/src/main/resources/swagger.api/examples/streamIdsJobResponse.sample b/src/main/resources/swagger.api/examples/streamIdsJobResponse.sample deleted file mode 100644 index d11223848..000000000 --- a/src/main/resources/swagger.api/examples/streamIdsJobResponse.sample +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "eea1432c-beb8-4f4f-b96a-f8de977f1106", - "query": "title=*", - "status": "completed", - "createdDate": "1974-12-03T00:00:00" -} diff --git a/src/main/resources/swagger.api/examples/unknownError.sample b/src/main/resources/swagger.api/examples/unknownError.sample deleted file mode 100644 index d0f726dbb..000000000 --- a/src/main/resources/swagger.api/examples/unknownError.sample +++ /dev/null @@ -1,10 +0,0 @@ -{ - "errors": [ - { - "message": "Illegal argument error" - "type": "IllegalArgumentException", - "code": "unknown_error" - } - ], - "total_records": 1 -} diff --git a/src/main/resources/swagger.api/examples/validationErrorResponse.sample b/src/main/resources/swagger.api/examples/validationErrorResponse.sample deleted file mode 100644 index 329d17131..000000000 --- a/src/main/resources/swagger.api/examples/validationErrorResponse.sample +++ /dev/null @@ -1,16 +0,0 @@ -{ - "errors": [ - { - "message": "must not be null", - "type": "MethodArgumentNotValidException", - "code": "validation_error", - "parameters": [ - { - "key": "parameter", - "value": "null" - } - ] - } - ], - "total_records": 1 -} diff --git a/src/main/resources/swagger.api/mod-search-2.yaml b/src/main/resources/swagger.api/mod-search-2.yaml deleted file mode 100644 index bec0bb6e0..000000000 --- a/src/main/resources/swagger.api/mod-search-2.yaml +++ /dev/null @@ -1,252 +0,0 @@ -openapi: 3.0.0 -info: - title: Search API - version: v2.1.0 - description: Search API - -servers: - - url: https://folio-dev-spitfire-okapi.ci.folio.org/ - -paths: - /search/instances: - $ref: './paths/search-instances/search-instances.yaml' - - /search/instances/ids: - $ref: './paths/search-instances/search-instances-ids.yaml' - - /search/holdings/ids: - $ref: './paths/search-holdings/search-holdings-ids.yaml' - - /search/{recordType}/facets: - $ref: './paths/search-facets/search-record-type-facets.yaml' - - /search/authorities: - $ref: './paths/search-authorities/search-authorities.yaml' - - /search/resources/jobs/{jobId}: - $ref: './paths/search-resources/search-resources-jobs-job-id.yaml' - - /search/resources/jobs: - $ref: './paths/search-resources/search-resources-jobs.yaml' - - /search/resources/jobs/{jobId}/ids: - $ref: './paths/search-resources/search-resources-jobs-job-id-ids.yaml' - - /search/consortium/holdings: - $ref: './paths/search-consortium/search-consortium-holdings.yaml' - - /search/consortium/items: - $ref: './paths/search-consortium/search-consortium-items.yaml' - - /search/index/indices: - $ref: './paths/search-index/search-index-indices.yaml' - - /search/index/mappings: - $ref: './paths/search-index/search-index-mappings.yaml' - - /search/index/records: - $ref: './paths/search-index/search-index-records.yaml' - - /search/index/settings: - $ref: './paths/search-index/search-index-settings.yaml' - - /search/index/inventory/reindex: - $ref: './paths/search-index/search-index-inventory-reindex.yaml' - - /search/config/languages: - $ref: './paths/search-config/search-config-languages.yaml' - - /search/config/languages/{code}: - $ref: './paths/search-config/search-config-languages-code.yaml' - - /search/config/features: - $ref: './paths/search-config/search-config-features.yaml' - - /search/config/features/{featureId}: - $ref: './paths/search-config/search-config-features-feature-id.yaml' - - /browse/call-numbers/instances: - $ref: './paths/browse-call-numbers/browse-call-numbers-instances.yaml' - - /browse/classification-numbers/{browseOptionId}/instances: - $ref: './paths/browse-classification-numbers/browse-option-id-instances.yaml' - - /browse/subjects/instances: - $ref: './paths/browse-subject/browse-subjects-instances.yaml' - - /browse/contributors/instances: - $ref: './paths/browse-contributors/browse-contributors-instances.yaml' - - /browse/authorities: - $ref: './paths/browse-authorities/browse-authorities.yaml' - - /browse/config/{browseType}: - $ref: './paths/browse-config/browse-type.yaml' - - /browse/config/{browseType}/{browseOptionId}: - $ref: './paths/browse-config/browse-type-browse-option-id.yaml' - -components: - schemas: - instance: - $ref: schemas/instance.json - item: - $ref: schemas/item.json - folioCreateIndexResponse: - $ref: schemas/folioCreateIndexResponse.json - folioIndexOperationResponse: - $ref: schemas/folioIndexOperationResponse.json - resourceEvent: - $ref: schemas/resourceEvent.json - indexRecordRequest: - type: array - items: - $ref: '#/components/schemas/resourceEvent' - instanceSearchResult: - $ref: schemas/response/instanceSearchResult.json - authoritySearchResult: - $ref: schemas/response/authoritySearchResult.json - callNumberBrowseResult: - $ref: schemas/response/callNumberBrowseResult.json - classificationNumberBrowseResult: - $ref: schemas/response/classificationNumberBrowseResult.json - subjectBrowseResult: - $ref: schemas/response/subjectBrowseResult.json - contributorBrowseResult: - $ref: schemas/response/instanceContributorBrowseResult.json - authorityBrowseResult: - $ref: schemas/response/authorityBrowseResult.json - facetResult: - $ref: schemas/response/facetResult.json - resourceIds: - $ref: schemas/response/resourceIds.json - errorResponse: - $ref: schemas/errors.json - reindexRequest: - $ref: schemas/request/reindexRequest.json - updateIndexDynamicSettingsRequest: - $ref: schemas/request/updateIndexDynamicSettingsRequest.json - RecordType: - enum: [ instances, authorities, contributors, subjects ] - type: string - CallNumberType: - enum: [ lc, dewey, nlm, sudoc, other, local ] - type: string - browseType: - type: string - enum: - - instance-classification - browseOptionType: - type: string - enum: - - all - - lc - - dewey - shelvingOrderAlgorithmType: - type: string - enum: - - lc - - dewey - - default - browseConfig: - type: object - properties: - id: - description: Option ID - $ref: "#/components/schemas/browseOptionType" - shelvingAlgorithm: - description: Defines shelving order algorithm - $ref: "#/components/schemas/shelvingOrderAlgorithmType" - typeIds: - description: Type IDs that should be used by the option - type: array - items: - description: Type ID - type: string - format: uuid - required: - - id - - shelvingAlgorithm - browseConfigCollection: - type: object - properties: - configs: - type: array - items: - $ref: '#/components/schemas/browseConfig' - totalRecords: - type: integer - consortiumHolding: - type: object - properties: - id: - description: Holdings ID - type: string - hrid: - description: Holdings HRID - type: string - tenantId: - description: Tenant ID of the Holding - type: string - instanceId: - description: Related Instance Id - type: string - discoverySuppress: - description: Discovery suppress flag - type: boolean - callNumberPrefix: - description: Call number prefix - type: string - callNumber: - description: Call number - type: string - copyNumber: - description: Copy number - type: string - permanentLocationId: - description: Permanent Location ID - type: string - consortiumHoldingCollection: - type: object - properties: - holdings: - type: array - items: - $ref: '#/components/schemas/consortiumHolding' - totalRecords: - type: integer - consortiumItem: - type: object - properties: - id: - description: Item ID - type: string - hrid: - description: Item HRID - type: string - tenantId: - description: Tenant ID of the Item - type: string - instanceId: - description: Related Instance Id - type: string - holdingsRecordId: - description: Related Holding Record Id - type: string - barcode: - description: Item barcode - type: string - consortiumItemCollection: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/consortiumItem' - totalRecords: - type: integer - sortOrder: - type: string - enum: - - asc - - desc diff --git a/src/main/resources/swagger.api/mod-search.yaml b/src/main/resources/swagger.api/mod-search.yaml index 1148df183..d3f01eb66 100644 --- a/src/main/resources/swagger.api/mod-search.yaml +++ b/src/main/resources/swagger.api/mod-search.yaml @@ -9,1066 +9,136 @@ servers: paths: /search/instances: - get: - operationId: searchInstances - description: Get a list of instances for CQL query - tags: - - search - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/limit-param' - - $ref: '#/components/parameters/offset-param' - - $ref: '#/components/parameters/expand-all-param' - responses: - '200': - description: 'Instance search result' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/instanceSearchResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-instances/search-instances.yaml' /search/instances/ids: - get: - operationId: getInstanceIds - description: Get a list of instance ids for CQL query - tags: - - search-resources-ids - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/content-type-header' - responses: - '200': - description: 'Instance ids as json stream' - content: - application/json: - example: examples/InstanceIdsResult.sample - application/text: - example: examples/IdsTextResult.sample - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-instances/search-instances-ids.yaml' /search/holdings/ids: - get: - operationId: getHoldingIds - description: Get a list of holding ids linked to instances found by the CQL query - tags: - - search-resources-ids - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/content-type-header' - responses: - '200': - description: 'Instance ids as json stream' - content: - application/json: - example: examples/HoldingIdsResult.sample - application/text: - example: examples/IdsTextResult.sample - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-holdings/search-holdings-ids.yaml' /search/{recordType}/facets: - get: - operationId: getFacets - description: Provides list of facets for the record type - tags: - - facets - parameters: - - name: recordType - required: true - in: path - schema: - $ref: '#/components/schemas/RecordType' - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/facet-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - responses: - '200': - description: 'Facet search result' - content: - application/json: - example: examples/facetResult.sample - schema: - $ref: '#/components/schemas/facetResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-facets/search-record-type-facets.yaml' /search/authorities: - get: - operationId: searchAuthorities - description: Get a list of authorities for CQL query - tags: - - search - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/limit-param' - - $ref: '#/components/parameters/offset-param' - - $ref: '#/components/parameters/expand-all-param' - - $ref: '#/components/parameters/include-number-of-titles' - responses: - '200': - description: 'Authorities search result' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/authoritySearchResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-authorities/search-authorities.yaml' /search/resources/jobs/{jobId}: - get: - operationId: getIdsJob - description: Get a job for the stream of resource ids. - tags: - - search-resources-ids - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/job-stream-id' - responses: - '200': - description: 'Job for the stream of resource ids' - content: - application/json: - example: examples/streamIdsJobResponse.sample - schema: - $ref: schemas/resourceIdsJob.json - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-resources/search-resources-jobs-job-id.yaml' /search/resources/jobs: - post: - operationId: submitIdsJob - description: Creates a job for the stream of resource ids. - tags: - - search-resources-ids - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - requestBody: - content: - application/json: - example: examples/streamIdsJobRequest.sample - schema: - $ref: schemas/resourceIdsJob.json - responses: - '200': - description: 'Job for the stream of resource ids' - content: - application/json: - example: examples/streamIdsJobResponse.sample - schema: - $ref: schemas/resourceIdsJob.json - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-resources/search-resources-jobs.yaml' /search/resources/jobs/{jobId}/ids: - get: - operationId: getResourceIds - description: Get a list of resource ids by job id - tags: - - search-resources-ids - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/job-stream-id' - responses: - '200': - description: 'Resources ids as a json stream' - content: - application/json: - example: examples/resourceIdsResult.sample - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-resources/search-resources-jobs-job-id-ids.yaml' /search/consortium/holdings: - get: - operationId: getConsortiumHoldings - description: Get a list of holdings (only for consortium environment) - tags: - - search-consortium - parameters: - - $ref: '#/components/parameters/instance-id-query-param' - - $ref: '#/components/parameters/tenant-id-query-param' - - $ref: '#/components/parameters/consortium-limit-param' - - $ref: '#/components/parameters/offset-param' - - $ref: '#/components/parameters/sort-by-holdings-param' - - $ref: '#/components/parameters/sort-order-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - responses: - '200': - description: List of holdings - content: - application/json: - schema: - $ref: '#/components/schemas/consortiumHoldingCollection' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-consortium/search-consortium-holdings.yaml' /search/consortium/items: - get: - operationId: getConsortiumItems - description: Get a list of items (only for consortium environment) - tags: - - search-consortium - parameters: - - $ref: '#/components/parameters/instance-id-query-param' - - $ref: '#/components/parameters/holdings-id-query-param' - - $ref: '#/components/parameters/tenant-id-query-param' - - $ref: '#/components/parameters/consortium-limit-param' - - $ref: '#/components/parameters/offset-param' - - $ref: '#/components/parameters/sort-by-item-param' - - $ref: '#/components/parameters/sort-order-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - responses: - '200': - description: List of items - content: - application/json: - schema: - $ref: '#/components/schemas/consortiumItemCollection' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' - - /browse/call-numbers/instances: - get: - operationId: browseInstancesByCallNumber - description: Provides list of instances for browsing by call number - tags: - - browse - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/browse-limit-param' - - $ref: '#/components/parameters/expand-all-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/highlight-match' - - $ref: '#/components/parameters/preceding-records-count' - - in: query - name: callNumberType - description: Type of call number - required: false - schema: - $ref: '#/components/schemas/CallNumberType' - responses: - '200': - description: 'Search result for browsing by call number' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/callNumberBrowseResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' - - /browse/classification-numbers/{browseOptionId}/instances: - get: - operationId: browseInstancesByClassificationNumber - description: Provides list of instances for browsing by classification number - tags: - - browse - parameters: - - $ref: '#/components/parameters/browse-option-id' - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/browse-limit-param' - - $ref: '#/components/parameters/expand-all-param' - - $ref: '#/components/parameters/highlight-match' - - $ref: '#/components/parameters/preceding-records-count' - - $ref: '#/components/parameters/x-okapi-tenant-header' - responses: - '200': - description: 'Search result for browsing by call number' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/classificationNumberBrowseResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' - - /browse/subjects/instances: - get: - operationId: browseInstancesBySubject - description: Provides list of instances for browsing by subject - tags: - - browse - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/limit-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/highlight-match' - - $ref: '#/components/parameters/preceding-records-count' - responses: - '200': - description: 'Search result for browsing by call number' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/subjectBrowseResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' - - /browse/contributors/instances: - get: - operationId: browseInstancesByContributor - description: Provides list of instances for browsing by contributor - tags: - - browse - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/limit-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/highlight-match' - - $ref: '#/components/parameters/preceding-records-count' - responses: - '200': - description: 'Search result for browsing by contributor' - content: - application/json: - example: examples/browseContributorsResult.sample - schema: - $ref: '#/components/schemas/contributorBrowseResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' - - /browse/authorities: - get: - operationId: browseAuthorities - description: Provides list of authorities by headingRef - tags: - - browse - parameters: - - $ref: '#/components/parameters/cql-query' - - $ref: '#/components/parameters/limit-param' - - $ref: '#/components/parameters/expand-all-param' - - $ref: '#/components/parameters/x-okapi-tenant-header' - - $ref: '#/components/parameters/highlight-match' - - $ref: '#/components/parameters/preceding-records-count' - responses: - '200': - description: 'Search result for browsing by authorities' - content: - application/json: - example: examples/searchResult.sample - schema: - $ref: '#/components/schemas/authorityBrowseResult' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-consortium/search-consortium-items.yaml' /search/index/indices: - post: - operationId: createIndices - description: Creates indices for passed resource name and tenant id in request header. - tags: - - index-management - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - requestBody: - content: - application/json: - example: examples/indexRequestBody.sample - schema: - $ref: schemas/request/createIndexRequest.json - responses: - '200': - description: Response with created indices and status (error message will be present if operation failed) - content: - application/json: - schema: - $ref: '#/components/schemas/folioCreateIndexResponse' - '400': - $ref: '#/components/responses/badRequestResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-index/search-index-indices.yaml' /search/index/mappings: - post: - operationId: updateMappings - description: Creates mappings for passed resource name and tenant id in request header. - tags: - - index-management - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - requestBody: - content: - application/json: - schema: - $ref: schemas/request/updateMappingsRequest.json - responses: - '200': - description: Response with created indices and status (error message will be present if operation failed) - content: - application/json: - schema: - $ref: '#/components/schemas/folioIndexOperationResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-index/search-index-mappings.yaml' /search/index/records: - post: - operationId: indexRecords - description: Indexes the records into elasticsearch. - tags: - - index-management - requestBody: - content: - application/json: - example: examples/indexRecordRequestBody.sample - schema: - $ref: '#/components/schemas/indexRecordRequest' - responses: - '200': - description: Response with created indices and status (error message will be present if operation failed) - content: - application/json: - example: examples/indexRecordResponse.sample - schema: - $ref: '#/components/schemas/folioIndexOperationResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-index/search-index-records.yaml' /search/index/settings: - put: - operationId: updateIndexDynamicSettings - description: Update Index Dynamic Settings data. - tags: - - index-management - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/updateIndexDynamicSettingsRequest' - responses: - '200': - description: Response with updated index settings and status (error message will be present if operation failed) - content: - application/json: - schema: - $ref: '#/components/schemas/folioIndexOperationResponse' - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-index/search-index-settings.yaml' /search/index/inventory/reindex: - post: - operationId: reindexInventoryRecords - description: Initiates reindex for the inventory records - tags: - - index-management - requestBody: - content: - application/json: - example: examples/reindexRequest.sample - schema: - $ref: '#/components/schemas/reindexRequest' - parameters: - - $ref: '#/components/parameters/x-okapi-tenant-header' - responses: - '200': - description: Reindex operation has been started - content: - application/json: - schema: - $ref: schemas/reindexJob.json - '500': - $ref: '#/components/responses/internalServerErrorResponse' + $ref: './paths/search-index/search-index-inventory-reindex.yaml' /search/config/languages: - post: - operationId: createLanguageConfig - description: Save languages that will be used for analyzers - tags: - - config - requestBody: - content: - application/json: - schema: - $ref: schemas/languageConfig.json - responses: - '200': - description: Language support has been added. - content: - application/json: - schema: - $ref: schemas/languageConfig.json - '422': - $ref: '#/components/responses/unprocessableEntityResponse' - get: - operationId: getAllLanguageConfigs - description: Get all supported languages - tags: - - config - responses: - '200': - description: All supported languages - content: - application/json: - schema: - $ref: schemas/languageConfigs.json + $ref: './paths/search-config/search-config-languages.yaml' /search/config/languages/{code}: - put: - operationId: updateLanguageConfig - description: Update language config settings - tags: - - config - parameters: - - $ref: '#/components/parameters/language-code' - requestBody: - content: - application/json: - schema: - $ref: schemas/languageConfig.json - responses: - '200': - description: Language support has been added. - content: - application/json: - schema: - $ref: schemas/languageConfig.json - '422': - $ref: '#/components/responses/unprocessableEntityResponse' - delete: - operationId: deleteLanguageConfig - description: Delete all supported languages - tags: - - config - parameters: - - $ref: '#/components/parameters/language-code' - responses: - '204': - description: Language support has been removed - '404': - description: No language support is found + $ref: './paths/search-config/search-config-languages-code.yaml' /search/config/features: - post: - operationId: saveFeatureConfiguration - description: Save feature configuration (enables or disables pre-defined optional search options) - tags: - - config - requestBody: - content: - application/json: - schema: - $ref: schemas/featureConfig.json - responses: - '200': - description: Language support has been added. - content: - application/json: - schema: - $ref: schemas/featureConfig.json - '400': - $ref: '#/components/responses/badRequestResponse' - '422': - $ref: '#/components/responses/unprocessableEntityResponse' - get: - operationId: getAllFeatures - description: Get all feature configurations per tenant - tags: - - config - responses: - '200': - description: All feature configurations - content: - application/json: - schema: - $ref: schemas/featureConfigs.json + $ref: './paths/search-config/search-config-features.yaml' /search/config/features/{featureId}: - put: - operationId: updateFeatureConfiguration - description: Update feature configuration settings - tags: - - config - parameters: - - $ref: '#/components/parameters/feature-id' - requestBody: - content: - application/json: - schema: - $ref: schemas/featureConfig.json - responses: - '200': - description: Feature configuration has been added. - content: - application/json: - schema: - $ref: schemas/featureConfig.json - '400': - $ref: '#/components/responses/badRequestResponse' - '422': - $ref: '#/components/responses/unprocessableEntityResponse' - delete: - operationId: deleteFeatureConfigurationById - description: Delete feature configuration by id - tags: - - config - parameters: - - $ref: '#/components/parameters/feature-id' - responses: - '204': - description: Feature configuration has been removed - '404': - description: No feature configuration is found by id + $ref: './paths/search-config/search-config-features-feature-id.yaml' + + /browse/call-numbers/instances: + $ref: './paths/browse-call-numbers/browse-call-numbers-instances.yaml' + + /browse/classification-numbers/{browseOptionId}/instances: + $ref: './paths/browse-classification-numbers/browse-option-id-instances.yaml' + + /browse/subjects/instances: + $ref: './paths/browse-subject/browse-subjects-instances.yaml' + + /browse/contributors/instances: + $ref: './paths/browse-contributors/browse-contributors-instances.yaml' + + /browse/authorities: + $ref: './paths/browse-authorities/browse-authorities.yaml' /browse/config/{browseType}: - get: - operationId: getBrowseConfigs - description: Get all configurations for browse type - tags: - - config - parameters: - - $ref: '#/components/parameters/browse-type' - responses: - '200': - description: All browse configurations for type - content: - application/json: - schema: - $ref: '#/components/schemas/browseConfigCollection' + $ref: './paths/browse-config/browse-type.yaml' /browse/config/{browseType}/{browseOptionId}: - put: - operationId: putBrowseConfig - description: Update configuration for browse type - tags: - - config - parameters: - - $ref: '#/components/parameters/browse-type' - - $ref: '#/components/parameters/browse-option-id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/browseConfig' - responses: - '200': - description: Browse configuration has been added/updated. - '400': - $ref: '#/components/responses/badRequestResponse' - '422': - $ref: '#/components/responses/unprocessableEntityResponse' + $ref: './paths/browse-config/browse-type-browse-option-id.yaml' components: - schemas: - instance: - $ref: schemas/instance.json - item: - $ref: schemas/item.json - folioCreateIndexResponse: - $ref: schemas/folioCreateIndexResponse.json - folioIndexOperationResponse: - $ref: schemas/folioIndexOperationResponse.json - resourceEvent: - $ref: schemas/resourceEvent.json - indexRecordRequest: - type: array - items: - $ref: '#/components/schemas/resourceEvent' - instanceSearchResult: - $ref: schemas/response/instanceSearchResult.json - authoritySearchResult: - $ref: schemas/response/authoritySearchResult.json - callNumberBrowseResult: - $ref: schemas/response/callNumberBrowseResult.json - classificationNumberBrowseResult: - $ref: schemas/response/classificationNumberBrowseResult.json - subjectBrowseResult: - $ref: schemas/response/subjectBrowseResult.json - contributorBrowseResult: - $ref: schemas/response/instanceContributorBrowseResult.json - authorityBrowseResult: - $ref: schemas/response/authorityBrowseResult.json - facetResult: - $ref: schemas/response/facetResult.json - resourceIds: - $ref: schemas/response/resourceIds.json - errorResponse: - $ref: schemas/errors.json - reindexRequest: - $ref: schemas/request/reindexRequest.json - updateIndexDynamicSettingsRequest: - $ref: schemas/request/updateIndexDynamicSettingsRequest.json - RecordType: - enum: [ instances, authorities, contributors, subjects ] - type: string - CallNumberType: - enum: [ lc, dewey, nlm, sudoc, other, local ] - type: string - browseType: - type: string - enum: - - instance-classification - browseOptionType: - type: string - enum: - - all - - lc - - dewey - shelvingOrderAlgorithmType: - type: string - enum: - - lc - - dewey - - default - browseConfig: - type: object - properties: - id: - description: Option ID - $ref: "#/components/schemas/browseOptionType" - shelvingAlgorithm: - description: Defines shelving order algorithm - $ref: "#/components/schemas/shelvingOrderAlgorithmType" - typeIds: - description: Type IDs that should be used by the option - type: array - items: - description: Type ID - type: string - format: uuid - required: - - id - - shelvingAlgorithm - browseConfigCollection: - type: object - properties: - configs: - type: array - items: - $ref: '#/components/schemas/browseConfig' - totalRecords: - type: integer - consortiumHolding: - type: object - properties: - id: - description: Holdings ID - type: string - hrid: - description: Holdings HRID - type: string - tenantId: - description: Tenant ID of the Holding - type: string - instanceId: - description: Related Instance Id - type: string - discoverySuppress: - description: Discovery suppress flag - type: boolean - callNumberPrefix: - description: Call number prefix - type: string - callNumber: - description: Call number - type: string - copyNumber: - description: Copy number - type: string - permanentLocationId: - description: Permanent Location ID - type: string - consortiumHoldingCollection: - type: object - properties: - holdings: - type: array - items: - $ref: '#/components/schemas/consortiumHolding' - totalRecords: - type: integer - consortiumItem: - type: object - properties: - id: - description: Item ID - type: string - hrid: - description: Item HRID - type: string - tenantId: - description: Tenant ID of the Item - type: string - instanceId: - description: Related Instance Id - type: string - holdingsRecordId: - description: Related Holding Record Id - type: string - barcode: - description: Item barcode - type: string - consortiumItemCollection: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/consortiumItem' - totalRecords: - type: integer - sortOrder: - type: string - enum: - - asc - - desc - responses: unprocessableEntityResponse: - description: Validation error for the request. - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' + $ref: './responses/unprocessableEntityResponse.yaml' badRequestResponse: - description: Validation errors - content: - application/json: - example: examples/validationErrorResponse.sample - schema: - $ref: "#/components/schemas/errorResponse" + $ref: './responses/badRequestResponse.yaml' internalServerErrorResponse: - description: When unhandled exception occurred during code execution, e.g. NullPointerException - content: - application/json: - example: examples/unknownError.sample + $ref: './responses/internalServerErrorResponse.yaml' parameters: limit-param: - in: query - name: limit - description: Limit the number of elements returned in the response. - schema: - type: integer - minimum: 0 - maximum: 500 - default: 100 + $ref: './parameters/limit-param.yaml' consortium-limit-param: - in: query - name: limit - description: Limit the number of elements returned in the response. - schema: - type: integer - minimum: 0 - maximum: 1000 - default: 100 + $ref: './parameters/consortium-limit-param.yaml' browse-limit-param: - in: query - name: limit - description: Limit the number of elements returned in the browse response. - schema: - type: integer - minimum: 0 - maximum: 100 - default: 100 + $ref: './parameters/browse-limit-param.yaml' offset-param: - in: query - name: offset - description: Skip over a number of elements by specifying an offset value for the query. - schema: - type: integer - minimum: 0 - maximum: 9999 - default: 0 + $ref: './parameters/offset-param.yaml' cql-query: - name: query - in: query - required: true - description: A CQL query string with search conditions. - schema: - type: string + $ref: './parameters/cql-query.yaml' expand-all-param: - in: query - name: expandAll - description: Whether to return only basic properties or entire instance. - schema: - type: boolean - default: false + $ref: './parameters/expand-all-param.yaml' facet-param: - in: query - name: facet - description: List of facet names. - required: true - schema: - type: array - items: - type: string + $ref: './parameters/facet-param.yaml' language-code: - name: code - in: path - required: true - description: Language code - schema: - type: string - pattern: '[a-zA-Z]{3}' + $ref: './parameters/language-code.yaml' feature-id: - name: featureId - in: path - required: true - description: Feature id (name) - schema: - type: string - enum: - - search.all.fields - - browse.cn.intermediate.values - - browse.cn.intermediate.remove.duplicates - - browse.classifications + $ref: './parameters/feature-id.yaml' x-okapi-tenant-header: - name: x-okapi-tenant - in: header - description: X-Okapi-Tenant header value - required: true - schema: - type: string + $ref: './parameters/x-okapi-tenant-header.yaml' content-type-header: - name: Content-Type - in: header - description: Content-Type header value - required: false - schema: - type: string + $ref: './parameters/content-type-header.yaml' preceding-records-count: - in: query - name: precedingRecordsCount - description: Number of preceding records for browsing around and around-including options - required: false - schema: - type: integer - minimum: 1 - maximum: 100 + $ref: './parameters/preceding-records-count.yaml' highlight-match: - in: query - name: highlightMatch - description: Whether to highlight matched resource by query input or not. - required: false - schema: - type: boolean - default: true + $ref: './parameters/highlight-match.yaml' job-stream-id: - in: path - name: jobId - description: UUID of the job to get - required: true - schema: - type: string + $ref: './parameters/job-stream-id.yaml' instance-id-query-param: - in: query - name: instanceId - description: UUID of the instance - required: false - schema: - type: string + $ref: './parameters/instance-id-query-param.yaml' holdings-id-query-param: - in: query - name: holdingsRecordId - description: UUID of the holdings record - required: false - schema: - type: string + $ref: './parameters/holdings-id-query-param.yaml' tenant-id-query-param: - in: query - name: tenantId - description: Tenant ID - required: false - schema: - type: string + $ref: './parameters/tenant-id-query-param.yaml' sort-by-holdings-param: - in: query - name: sortBy - description: | - Defines a field to sort by. - Possible values: - - id - - hrid - - tenantId - - instanceId - - callNumberPrefix - - callNumber - - copyNumber - - permanentLocationId - required: false - schema: - type: string + $ref: './parameters/sort-by-holdings-param.yaml' sort-by-item-param: - in: query - name: sortBy - description: | - Defines a field to sort by. - Possible values: - - id - - hrid - - tenantId - - instanceId - - holdingsRecordId - - barcode - required: false - schema: - type: string + $ref: './parameters/sort-by-item-param.yaml' sort-order-param: - in: query - name: sortOrder - description: Defines sorting order - required: false - schema: - $ref: '#/components/schemas/sortOrder' + $ref: './parameters/sort-order-param.yaml' include-number-of-titles: - in: query - name: includeNumberOfTitles - description: Whether to perform a search for a number of linked instances. - schema: - type: boolean - default: true + $ref: './parameters/include-number-of-titles.yaml' browse-option-id: - name: browseOptionId - in: path - required: true - description: 'Browse option type' - schema: - $ref: '#/components/schemas/browseOptionType' + $ref: './parameters/browse-option-id.yaml' browse-type: - name: browseType - in: path - required: true - description: 'Browse feature type' - schema: - $ref: '#/components/schemas/browseType' + $ref: './parameters/browse-type.yaml' diff --git a/src/main/resources/swagger.api/parameters/browse-option-id.yaml b/src/main/resources/swagger.api/parameters/browse-option-id.yaml index 6ab455e5e..d808971c9 100644 --- a/src/main/resources/swagger.api/parameters/browse-option-id.yaml +++ b/src/main/resources/swagger.api/parameters/browse-option-id.yaml @@ -3,4 +3,4 @@ in: path required: true description: 'Browse option type' schema: - $ref: '../schemas/browseOptionType.yaml' + $ref: '../schemas/entity/browseOptionType.yaml' diff --git a/src/main/resources/swagger.api/parameters/browse-type.yaml b/src/main/resources/swagger.api/parameters/browse-type.yaml index 454e19fa4..4792a7e62 100644 --- a/src/main/resources/swagger.api/parameters/browse-type.yaml +++ b/src/main/resources/swagger.api/parameters/browse-type.yaml @@ -3,6 +3,4 @@ in: path required: true description: 'Browse feature type' schema: - type: string - enum: - - instance-classification + $ref: '../schemas/browseType.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 3755d8b86..7de14dd38 100644 --- a/src/main/resources/swagger.api/parameters/sort-order-param.yaml +++ b/src/main/resources/swagger.api/parameters/sort-order-param.yaml @@ -3,4 +3,4 @@ name: sortOrder description: Defines sorting order required: false schema: - $ref: '../schemas/sortOrder.yaml' + $ref: '../schemas/entity/sortOrder.yaml' diff --git a/src/main/resources/swagger.api/paths/browse-authorities/browse-authorities.yaml b/src/main/resources/swagger.api/paths/browse-authorities/browse-authorities.yaml index 2bbb1e9e4..ad05c5c15 100644 --- a/src/main/resources/swagger.api/paths/browse-authorities/browse-authorities.yaml +++ b/src/main/resources/swagger.api/paths/browse-authorities/browse-authorities.yaml @@ -16,7 +16,7 @@ get: content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/authorityBrowseResult.yaml' '400': 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 7d6f99dd7..0729d4fb5 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 @@ -15,14 +15,14 @@ get: description: Type of call number required: false schema: - $ref: '../../schemas/callNumberType.yaml' + $ref: '../../schemas/entity/callNumberType.yaml' responses: '200': description: 'Search result for browsing by call number' content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/callNumberBrowseResult.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/browse-classification-numbers/browse-option-id-instances.yaml b/src/main/resources/swagger.api/paths/browse-classification-numbers/browse-option-id-instances.yaml index e2983b8d8..1b496ab87 100644 --- a/src/main/resources/swagger.api/paths/browse-classification-numbers/browse-option-id-instances.yaml +++ b/src/main/resources/swagger.api/paths/browse-classification-numbers/browse-option-id-instances.yaml @@ -17,7 +17,7 @@ get: content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/classificationNumberBrowseResult.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/browse-config/browse-type-browse-option-id.yaml b/src/main/resources/swagger.api/paths/browse-config/browse-type-browse-option-id.yaml index 817a4a589..42ddda3f4 100644 --- a/src/main/resources/swagger.api/paths/browse-config/browse-type-browse-option-id.yaml +++ b/src/main/resources/swagger.api/paths/browse-config/browse-type-browse-option-id.yaml @@ -11,7 +11,7 @@ put: content: application/json: schema: - $ref: '../../schemas/browseConfig.yaml' + $ref: '../../schemas/entity/browseConfig.yaml' responses: '200': description: Browse configuration has been added/updated. diff --git a/src/main/resources/swagger.api/paths/browse-config/browse-type.yaml b/src/main/resources/swagger.api/paths/browse-config/browse-type.yaml index 82bd8b4fb..aaee93f61 100644 --- a/src/main/resources/swagger.api/paths/browse-config/browse-type.yaml +++ b/src/main/resources/swagger.api/paths/browse-config/browse-type.yaml @@ -11,4 +11,4 @@ get: content: application/json: schema: - $ref: '../../schemas/browseConfigCollection.yaml' + $ref: '../../schemas/entity/browseConfigCollection.yaml' diff --git a/src/main/resources/swagger.api/paths/browse-contributors/browse-contributors-instances.yaml b/src/main/resources/swagger.api/paths/browse-contributors/browse-contributors-instances.yaml index d26b3f6b3..51dc0131b 100644 --- a/src/main/resources/swagger.api/paths/browse-contributors/browse-contributors-instances.yaml +++ b/src/main/resources/swagger.api/paths/browse-contributors/browse-contributors-instances.yaml @@ -15,9 +15,9 @@ get: content: application/json: example: - $ref: '../../examples/browseContributorsResult.yaml' + $ref: '../../examples/result/browseContributorsResult.yaml' schema: - $ref: '../../schemas/response/instanceContributorBrowseResult.yaml' + $ref: '../../schemas/response/contributorBrowseResult.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/browse-subject/browse-subjects-instances.yaml b/src/main/resources/swagger.api/paths/browse-subject/browse-subjects-instances.yaml index ef78bce2d..d87894a44 100644 --- a/src/main/resources/swagger.api/paths/browse-subject/browse-subjects-instances.yaml +++ b/src/main/resources/swagger.api/paths/browse-subject/browse-subjects-instances.yaml @@ -15,7 +15,7 @@ get: content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/subjectBrowseResult.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/search-authorities/search-authorities.yaml b/src/main/resources/swagger.api/paths/search-authorities/search-authorities.yaml index 93aec3d1f..d558a3016 100644 --- a/src/main/resources/swagger.api/paths/search-authorities/search-authorities.yaml +++ b/src/main/resources/swagger.api/paths/search-authorities/search-authorities.yaml @@ -16,7 +16,7 @@ get: content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/authoritySearchResult.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/search-config/search-config-features-feature-id.yaml b/src/main/resources/swagger.api/paths/search-config/search-config-features-feature-id.yaml index 77fab45cc..ccc5042b4 100644 --- a/src/main/resources/swagger.api/paths/search-config/search-config-features-feature-id.yaml +++ b/src/main/resources/swagger.api/paths/search-config/search-config-features-feature-id.yaml @@ -9,14 +9,14 @@ put: content: application/json: schema: - $ref: '../../schemas/featureConfig.yaml' + $ref: '../../schemas/entity/featureConfig.yaml' responses: '200': description: Feature configuration has been added. content: application/json: schema: - $ref: '../../schemas/featureConfig.yaml' + $ref: '../../schemas/entity/featureConfig.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '422': diff --git a/src/main/resources/swagger.api/paths/search-config/search-config-features.yaml b/src/main/resources/swagger.api/paths/search-config/search-config-features.yaml index 66053957b..bd274da32 100644 --- a/src/main/resources/swagger.api/paths/search-config/search-config-features.yaml +++ b/src/main/resources/swagger.api/paths/search-config/search-config-features.yaml @@ -7,14 +7,14 @@ post: content: application/json: schema: - $ref: '../../schemas/featureConfig.yaml' + $ref: '../../schemas/entity/featureConfig.yaml' responses: '200': description: Language support has been added. content: application/json: schema: - $ref: '../../schemas/featureConfig.yaml' + $ref: '../../schemas/entity/featureConfig.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '422': @@ -30,4 +30,4 @@ get: content: application/json: schema: - $ref: '../../schemas/featureConfigs.yaml' + $ref: '../../schemas/entity/featureConfigs.yaml' diff --git a/src/main/resources/swagger.api/paths/search-config/search-config-languages-code.yaml b/src/main/resources/swagger.api/paths/search-config/search-config-languages-code.yaml index d5f5c0455..5cf32bcae 100644 --- a/src/main/resources/swagger.api/paths/search-config/search-config-languages-code.yaml +++ b/src/main/resources/swagger.api/paths/search-config/search-config-languages-code.yaml @@ -9,14 +9,14 @@ put: content: application/json: schema: - $ref: '../../schemas/languageConfig.json' + $ref: '../../schemas/entity/languageConfig.yaml' responses: '200': description: Language support has been added. content: application/json: schema: - $ref: '../../schemas/languageConfig.json' + $ref: '../../schemas/entity/languageConfig.yaml' '422': $ref: '../../responses/unprocessableEntityResponse.yaml' delete: diff --git a/src/main/resources/swagger.api/paths/search-config/search-config-languages.yaml b/src/main/resources/swagger.api/paths/search-config/search-config-languages.yaml index cf936fa9f..820e3592d 100644 --- a/src/main/resources/swagger.api/paths/search-config/search-config-languages.yaml +++ b/src/main/resources/swagger.api/paths/search-config/search-config-languages.yaml @@ -7,14 +7,14 @@ post: content: application/json: schema: - $ref: '../../schemas/languageConfig.yaml' + $ref: '../../schemas/entity/languageConfig.yaml' responses: '200': description: Language support has been added. content: application/json: schema: - $ref: '../../schemas/languageConfig.yaml' + $ref: '../../schemas/entity/languageConfig.yaml' '422': $ref: '../../responses/unprocessableEntityResponse.yaml' get: @@ -28,4 +28,4 @@ get: content: application/json: schema: - $ref: '../../schemas/languageConfigs.yaml' + $ref: '../../schemas/entity/languageConfigs.yaml' diff --git a/src/main/resources/swagger.api/paths/search-consortium/search-consortium-holdings.yaml b/src/main/resources/swagger.api/paths/search-consortium/search-consortium-holdings.yaml index 84477b743..fca6b0f9c 100644 --- a/src/main/resources/swagger.api/paths/search-consortium/search-consortium-holdings.yaml +++ b/src/main/resources/swagger.api/paths/search-consortium/search-consortium-holdings.yaml @@ -17,7 +17,7 @@ get: content: application/json: schema: - $ref: '../../schemas/consortiumHoldingCollection.yaml' + $ref: '../../schemas/entity/consortiumHoldingCollection.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/search-consortium/search-consortium-items.yaml b/src/main/resources/swagger.api/paths/search-consortium/search-consortium-items.yaml index 2321eb972..dc49c0013 100644 --- a/src/main/resources/swagger.api/paths/search-consortium/search-consortium-items.yaml +++ b/src/main/resources/swagger.api/paths/search-consortium/search-consortium-items.yaml @@ -18,7 +18,7 @@ get: content: application/json: schema: - $ref: '../../schemas/consortiumItemCollection.yaml' + $ref: '../../schemas/entity/consortiumItemCollection.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': 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 c66745b28..4f4525e37 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 @@ -8,7 +8,7 @@ get: required: true in: path schema: - $ref: '../../schemas/RecordType.yaml' + $ref: '../../schemas/entity/RecordType.yaml' - $ref: '../../parameters/cql-query.yaml' - $ref: '../../parameters/facet-param.yaml' - $ref: '../../parameters/x-okapi-tenant-header.yaml' @@ -18,9 +18,9 @@ get: content: application/json: example: - $ref: '../../examples/facetResult.yaml' + $ref: '../../examples/result/facetResult.yaml' schema: - $ref: '../../schemas/facetResult.yaml' + $ref: '../../schemas/response/facetResult.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/search-holdings/search-holdings-ids.yaml b/src/main/resources/swagger.api/paths/search-holdings/search-holdings-ids.yaml index d56eeb9e1..941d24c8e 100644 --- a/src/main/resources/swagger.api/paths/search-holdings/search-holdings-ids.yaml +++ b/src/main/resources/swagger.api/paths/search-holdings/search-holdings-ids.yaml @@ -13,10 +13,10 @@ get: content: application/json: example: - $ref: '../../examples/HoldingIdsResult.yaml' + $ref: '../../examples/result/HoldingIdsResult.yaml' application/text: example: - $ref: '../../examples/IdsTextResult.yaml' + $ref: '../../examples/result/IdsTextResult.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': 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 35f11eb57..9b3f87bc6 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 @@ -9,7 +9,7 @@ post: content: application/json: example: - $ref: '../../examples/indexRequestBody.yaml' + $ref: '../../examples/request/indexRequestBody.yaml' schema: $ref: '../../schemas/request/createIndexRequest.yaml' responses: @@ -18,7 +18,7 @@ post: content: application/json: schema: - $ref: '../../schemas/folioCreateIndexResponse.yaml' + $ref: '../../schemas/response/folioCreateIndexResponse.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/search-index/search-index-inventory-reindex.yaml b/src/main/resources/swagger.api/paths/search-index/search-index-inventory-reindex.yaml index 98374a15e..33f0cc61d 100644 --- a/src/main/resources/swagger.api/paths/search-index/search-index-inventory-reindex.yaml +++ b/src/main/resources/swagger.api/paths/search-index/search-index-inventory-reindex.yaml @@ -7,7 +7,7 @@ post: content: application/json: example: - $ref: '../../examples/reindexRequest.yaml' + $ref: '../../examples/request/reindexRequest.yaml' schema: $ref: '../../schemas/request/reindexRequest.yaml' parameters: @@ -18,6 +18,6 @@ post: content: application/json: schema: - $ref: '../../schemas/reindexJob.yaml' + $ref: '../../schemas/entity/reindexJob.yaml' '500': $ref: '../../responses/internalServerErrorResponse.yaml' 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 3027c06c9..b4d091677 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/indexRecordRequestBody.yaml' + $ref: '../../examples/request/indexRecordRequestBody.yaml' schema: $ref: '../../schemas/request/indexRecordRequest.yaml' responses: @@ -16,8 +16,8 @@ post: content: application/json: example: - $ref: '../../examples/indexRecordResponse.yaml' + $ref: '../../examples/response/indexRecordResponse.yaml' schema: - $ref: '../../schemas/folioIndexOperationResponse.yaml' + $ref: '../../schemas/response/folioIndexOperationResponse.yaml' '500': $ref: '../../responses/internalServerErrorResponse.yaml' diff --git a/src/main/resources/swagger.api/paths/search-index/search-index-settings.yaml b/src/main/resources/swagger.api/paths/search-index/search-index-settings.yaml index 754f133fd..608c4f16a 100644 --- a/src/main/resources/swagger.api/paths/search-index/search-index-settings.yaml +++ b/src/main/resources/swagger.api/paths/search-index/search-index-settings.yaml @@ -16,6 +16,6 @@ put: content: application/json: schema: - $ref: '../../schemas/folioIndexOperationResponse.yaml' + $ref: '../../schemas/response/folioIndexOperationResponse.yaml' '500': $ref: '../../responses/internalServerErrorResponse.yaml' diff --git a/src/main/resources/swagger.api/paths/search-instances/search-instances-ids.yaml b/src/main/resources/swagger.api/paths/search-instances/search-instances-ids.yaml index a80b5f449..52bba0c7b 100644 --- a/src/main/resources/swagger.api/paths/search-instances/search-instances-ids.yaml +++ b/src/main/resources/swagger.api/paths/search-instances/search-instances-ids.yaml @@ -13,10 +13,10 @@ get: content: application/json: example: - $ref: '../../examples/InstanceIdsResult.yaml' + $ref: '../../examples/result/InstanceIdsResult.yaml' application/text: example: - $ref: '../../examples/IdsTextResult.yaml' + $ref: '../../examples/result/IdsTextResult.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/paths/search-instances/search-instances.yaml b/src/main/resources/swagger.api/paths/search-instances/search-instances.yaml index 6f9d1cb43..ff2515614 100644 --- a/src/main/resources/swagger.api/paths/search-instances/search-instances.yaml +++ b/src/main/resources/swagger.api/paths/search-instances/search-instances.yaml @@ -15,7 +15,7 @@ get: content: application/json: example: - $ref: '../../examples/searchResult.yaml' + $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/instanceSearchResult.yaml' '400': diff --git a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id-ids.yaml b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id-ids.yaml index 43223fbf0..fe68f7209 100644 --- a/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id-ids.yaml +++ b/src/main/resources/swagger.api/paths/search-resources/search-resources-jobs-job-id-ids.yaml @@ -12,7 +12,7 @@ get: content: application/json: example: - $ref: '../../examples/resourceIdsResult.yaml' + $ref: '../../examples/result/resourceIdsResult.yaml' '400': $ref: '../../responses/badRequestResponse.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 064b77259..402880dd9 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 @@ -12,9 +12,9 @@ get: content: application/json: example: - $ref: '../../examples/streamIdsJobResponse.yaml' + $ref: '../../examples/response/streamIdsJobResponse.yaml' schema: - $ref: '../../schemas/resourceIdsJob.yaml' + $ref: '../../schemas/entity/resourceIdsJob.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': 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 3b32c568b..e378ce90d 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 @@ -9,18 +9,18 @@ post: content: application/json: example: - $ref: '../../examples/streamIdsJobRequest.yaml' + $ref: '../../examples/request/streamIdsJobRequest.yaml' schema: - $ref: '../../schemas/resourceIdsJob.yaml' + $ref: '../../schemas/entity/resourceIdsJob.yaml' responses: '200': description: 'Job for the stream of resource ids' content: application/json: example: - $ref: '../../examples/streamIdsJobResponse.yaml' + $ref: '../../examples/response/streamIdsJobResponse.yaml' schema: - $ref: '../../schemas/resourceIdsJob.yaml' + $ref: '../../schemas/entity/resourceIdsJob.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': diff --git a/src/main/resources/swagger.api/responses/badRequestResponse.yaml b/src/main/resources/swagger.api/responses/badRequestResponse.yaml index 3ec23ea86..cb35f8c3b 100644 --- a/src/main/resources/swagger.api/responses/badRequestResponse.yaml +++ b/src/main/resources/swagger.api/responses/badRequestResponse.yaml @@ -2,6 +2,6 @@ description: Validation errors content: application/json: example: - $ref: "../examples/validationErrorResponse.yaml" + $ref: "../examples/response/validationErrorResponse.yaml" schema: - $ref: "../schemas/errors.yaml" + $ref: "../schemas/response/errorResponse.yaml" diff --git a/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml b/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml index 17ebaf381..baef976f1 100644 --- a/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml +++ b/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml @@ -2,4 +2,4 @@ description: When unhandled exception occurred during code execution, e.g. NullP content: application/json: example: - $ref: "../examples/unknownError.yaml" + $ref: "../examples/response/unknownError.yaml" diff --git a/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml b/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml index e1907d39c..22eef72eb 100644 --- a/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml +++ b/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml @@ -2,4 +2,4 @@ description: Validation error for the request. content: application/json: schema: - $ref: '../schemas/errors.yaml' + $ref: '../schemas/response/errorResponse.yaml' diff --git a/src/main/resources/swagger.api/schemas/RecordType.yaml b/src/main/resources/swagger.api/schemas/RecordType.yaml deleted file mode 100644 index 63df43ee8..000000000 --- a/src/main/resources/swagger.api/schemas/RecordType.yaml +++ /dev/null @@ -1,3 +0,0 @@ -RecordType: - enum: [ instances, authorities, contributors, subjects ] - type: string diff --git a/src/main/resources/swagger.api/schemas/alternativeTitle.json b/src/main/resources/swagger.api/schemas/alternativeTitle.json deleted file mode 100644 index 2c94c80cf..000000000 --- a/src/main/resources/swagger.api/schemas/alternativeTitle.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "An alternative title description", - "properties": { - "alternativeTitleTypeId": { - "type": "string", - "description": "UUID for an alternative title qualifier" - }, - "alternativeTitle": { - "type": "string", - "description": "An alternative title for the resource" - }, - "authorityId": { - "type": "string", - "description": "UUID of authority record that controls an alternative title" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/authority.json b/src/main/resources/swagger.api/schemas/authority.json deleted file mode 100644 index 49a3628da..000000000 --- a/src/main/resources/swagger.api/schemas/authority.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "An authority description", - "properties": { - "id": { - "type": "string", - "description": "Authority UUID" - }, - "tenantId": { - "description": "Tenant ID", - "type": "string" - }, - "shared": { - "description": "Indicate if it shared record", - "type": "boolean" - }, - "source": { - "type": "string", - "description": "The metadata source and its format of the underlying record to the authority record" - }, - "personalName": { - "type": "string", - "description": "Heading personal name" - }, - "sftPersonalName": { - "type": "array", - "description": "See from tracing personal names", - "items": { - "type": "string", - "description": "See from tracing personal name" - } - }, - "saftPersonalName": { - "type": "array", - "description": "See also from tracing personal names", - "items": { - "type": "string", - "description": "See also from tracing personal name" - } - }, - "personalNameTitle": { - "type": "string", - "description": "Heading personal name title" - }, - "sftPersonalNameTitle": { - "type": "array", - "description": "See from tracing personal name title", - "items": { - "type": "string" - } - }, - "saftPersonalNameTitle": { - "type": "array", - "description": "See also from tracing personal name title", - "items": { - "type": "string" - } - }, - "corporateName": { - "type": "string", - "description": "Heading corporate name" - }, - "sftCorporateName": { - "type": "array", - "description": "See from tracing corporate names", - "items": { - "type": "string", - "description": "See from tracing corporate name" - } - }, - "saftCorporateName": { - "type": "array", - "description": "See also from tracing corporate names", - "items": { - "type": "string", - "description": "See also from tracing corporate name" - } - }, - "corporateNameTitle": { - "type": "string", - "description": "Heading corporate name title" - }, - "sftCorporateNameTitle": { - "type": "array", - "description": "See from tracing corporate name title", - "items": { - "type": "string" - } - }, - "saftCorporateNameTitle": { - "type": "array", - "description": "See also from tracing corporate name title", - "items": { - "type": "string" - } - }, - "meetingName": { - "type": "string", - "description": "Heading meeting name" - }, - "sftMeetingName": { - "type": "array", - "description": "See from tracing meeting names", - "items": { - "type": "string", - "description": "See from tracing meeting name" - } - }, - "saftMeetingName": { - "type": "array", - "description": "See also from tracing meeting names", - "items": { - "type": "string", - "description": "See also from tracing meeting name" - } - }, - "meetingNameTitle": { - "type": "string", - "description": "Heading meeting name title" - }, - "sftMeetingNameTitle": { - "type": "array", - "description": "See from tracing meeting name title", - "items": { - "type": "string" - } - }, - "saftMeetingNameTitle": { - "type": "array", - "description": "See also from tracing meeting name title", - "items": { - "type": "string" - } - }, - "uniformTitle": { - "type": "string", - "description": "Heading uniform title" - }, - "sftUniformTitle": { - "type": "array", - "description": "See from tracing uniform titles", - "items": { - "type": "string", - "description": "See from tracing uniform title" - } - }, - "saftUniformTitle": { - "type": "array", - "description": "See also from tracing uniform titles", - "items": { - "type": "string", - "description": "See also from tracing uniform title" - } - }, - "topicalTerm": { - "type": "string", - "description": "Heading topical term" - }, - "sftTopicalTerm": { - "type": "array", - "description": "See from tracing topical terms", - "items": { - "type": "string", - "description": "See from tracing topical term" - } - }, - "saftTopicalTerm": { - "type": "array", - "description": "See also from tracing topical terms", - "items": { - "type": "string", - "description": "See also from tracing topical term" - } - }, - "subjectHeadings": { - "type": "string", - "description": "Children's subject headings" - }, - "geographicName": { - "type": "string", - "description": "Heading geographic name" - }, - "sftGeographicName": { - "type": "array", - "description": "See from tracing geographic names", - "items": { - "type": "string", - "description": "See from tracing geographic name" - } - }, - "saftGeographicName": { - "type": "array", - "description": "See also from tracing geographic names", - "items": { - "type": "string", - "description": "See also from tracing geographic name" - } - }, - "genreTerm": { - "type": "string", - "description": "Heading genre/form term" - }, - "sftGenreTerm": { - "type": "array", - "description": "See from tracing genre/form terms", - "items": { - "type": "string", - "description": "See from tracing genre/form term" - } - }, - "saftGenreTerm": { - "type": "array", - "description": "See also from tracing genre/form terms", - "items": { - "type": "string", - "description": "See also from tracing genre/form term" - } - }, - "identifiers": { - "type": "array", - "description": "An extensible set of name-value pairs of identifiers associated with the resource", - "items": { - "$ref": "identifiers.json" - } - }, - "notes": { - "type": "array", - "description": "Notes (e.g. nonpublic general note)", - "items": { - "type": "object", - "properties": { - "noteTypeId": { - "description": "ID of the type of note" - }, - "note": { - "type": "string", - "description": "Text content of the note" - } - } - } - }, - "metadata": { - "type": "object", - "description": "Creater, updater, creation date, last updated date", - "$ref": "metadata.json" - }, - "headingType": { - "type": "string", - "description": "Generated field by mod-search, used to easily identity the heading type of the record that provides authority information" - }, - "authRefType": { - "type": "string", - "description": "Generated field by mod-search, used to easily identity the authorized/reference type of the record that provides authority information" - }, - "headingRef": { - "type": "string", - "description": "Generated field by mod-search, used to easily identity the heading/reference of the record that provides authority information" - }, - "numberOfTitles": { - "type": "integer", - "description": "Generated field by mod-search, used to count the total number of bib records linked to this authority record" - }, - "sourceFileId": { - "type": "string", - "description": "Authority source file id; UUID" - }, - "naturalId": { - "type": "string", - "description": "Authority Natural ID" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/browseType.yaml b/src/main/resources/swagger.api/schemas/browseType.yaml new file mode 100644 index 000000000..0b6be8357 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/browseType.yaml @@ -0,0 +1,3 @@ +type: string +enum: + - instance-classification diff --git a/src/main/resources/swagger.api/schemas/circulationNote.json b/src/main/resources/swagger.api/schemas/circulationNote.json deleted file mode 100644 index 25e2bfdf2..000000000 --- a/src/main/resources/swagger.api/schemas/circulationNote.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Circulations note for item", - "type": "object", - "properties": { - "note": { - "type": "string", - "description": "Text to display" - }, - "staffOnly": { - "type": "boolean", - "description": "Flag to restrict display of this note", - "default": false - } - } -} diff --git a/src/main/resources/swagger.api/schemas/contributor.json b/src/main/resources/swagger.api/schemas/contributor.json deleted file mode 100644 index ecab6b1f4..000000000 --- a/src/main/resources/swagger.api/schemas/contributor.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "A contributor description", - "properties": { - "name": { - "type": "string", - "description": "Personal name, corporate name, meeting name" - }, - "contributorTypeId": { - "type": "string", - "description": "ID for the contributor type term defined as a reference table in settings" - }, - "contributorTypeText": { - "type": "string", - "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators" - }, - "contributorNameTypeId": { - "type": "string", - "description": "Contributor type terms defined by the MARC code list for relators" - }, - "authorityId": { - "type": "string", - "description": "ID of authority record that controls the contributor" - }, - "primary": { - "type": "boolean", - "description": "Whether this is the primary contributor" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/electronicAccess.json b/src/main/resources/swagger.api/schemas/electronicAccess.json deleted file mode 100644 index a7fcf769b..000000000 --- a/src/main/resources/swagger.api/schemas/electronicAccess.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Electronic access object", - "type": "object", - "properties": { - "uri": { - "type": "string", - "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources" - }, - "linkText": { - "type": "string", - "description": "The value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated" - }, - "materialsSpecification": { - "type": "string", - "description": "Materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)" - }, - "publicNote": { - "type": "string", - "description": "URL public note to be displayed in the discovery" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/entity/RecordType.yaml b/src/main/resources/swagger.api/schemas/entity/RecordType.yaml new file mode 100644 index 000000000..4799f7c08 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/RecordType.yaml @@ -0,0 +1,2 @@ +type: string +enum: [ instances, authorities, contributors, subjects ] diff --git a/src/main/resources/swagger.api/schemas/alternativeTitle.yaml b/src/main/resources/swagger.api/schemas/entity/alternativeTitle.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/alternativeTitle.yaml rename to src/main/resources/swagger.api/schemas/entity/alternativeTitle.yaml diff --git a/src/main/resources/swagger.api/schemas/authority.yaml b/src/main/resources/swagger.api/schemas/entity/authority.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/authority.yaml rename to src/main/resources/swagger.api/schemas/entity/authority.yaml diff --git a/src/main/resources/swagger.api/schemas/browseConfig.yaml b/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml similarity index 76% rename from src/main/resources/swagger.api/schemas/browseConfig.yaml rename to src/main/resources/swagger.api/schemas/entity/browseConfig.yaml index fdf39debf..c25d3b069 100644 --- a/src/main/resources/swagger.api/schemas/browseConfig.yaml +++ b/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml @@ -2,10 +2,10 @@ type: object properties: id: description: Option ID - $ref: "../schemas/browseOptionType.yaml" + $ref: "browseOptionType.yaml" shelvingAlgorithm: description: Defines shelving order algorithm - $ref: "../schemas/shelvingOrderAlgorithmType.yaml" + $ref: "shelvingOrderAlgorithmType.yaml" typeIds: description: Type IDs that should be used by the option type: array diff --git a/src/main/resources/swagger.api/schemas/browseConfigCollection.yaml b/src/main/resources/swagger.api/schemas/entity/browseConfigCollection.yaml similarity index 64% rename from src/main/resources/swagger.api/schemas/browseConfigCollection.yaml rename to src/main/resources/swagger.api/schemas/entity/browseConfigCollection.yaml index c2289949e..8588675ff 100644 --- a/src/main/resources/swagger.api/schemas/browseConfigCollection.yaml +++ b/src/main/resources/swagger.api/schemas/entity/browseConfigCollection.yaml @@ -3,6 +3,6 @@ properties: configs: type: array items: - $ref: '../schemas/browseConfig.yaml' + $ref: '../../schemas/entity/browseConfig.yaml' totalRecords: type: integer diff --git a/src/main/resources/swagger.api/schemas/browseOptionType.yaml b/src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/browseOptionType.yaml rename to src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml diff --git a/src/main/resources/swagger.api/schemas/callNumberType.yaml b/src/main/resources/swagger.api/schemas/entity/callNumberType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/callNumberType.yaml rename to src/main/resources/swagger.api/schemas/entity/callNumberType.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/circulationNote.yaml b/src/main/resources/swagger.api/schemas/entity/circulationNote.yaml new file mode 100644 index 000000000..5ddd0dc29 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/circulationNote.yaml @@ -0,0 +1,10 @@ +description: "Circulations note for item" +type: object +properties: + note: + type: string + description: "Text to display" + staffOnly: + type: boolean + description: "Flag to restrict display of this note" + default: false diff --git a/src/main/resources/swagger.api/schemas/consortiumHolding.yaml b/src/main/resources/swagger.api/schemas/entity/consortiumHolding.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/consortiumHolding.yaml rename to src/main/resources/swagger.api/schemas/entity/consortiumHolding.yaml diff --git a/src/main/resources/swagger.api/schemas/consortiumHoldingCollection.yaml b/src/main/resources/swagger.api/schemas/entity/consortiumHoldingCollection.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/consortiumHoldingCollection.yaml rename to src/main/resources/swagger.api/schemas/entity/consortiumHoldingCollection.yaml diff --git a/src/main/resources/swagger.api/schemas/consortiumItem.yaml b/src/main/resources/swagger.api/schemas/entity/consortiumItem.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/consortiumItem.yaml rename to src/main/resources/swagger.api/schemas/entity/consortiumItem.yaml diff --git a/src/main/resources/swagger.api/schemas/consortiumItemCollection.yaml b/src/main/resources/swagger.api/schemas/entity/consortiumItemCollection.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/consortiumItemCollection.yaml rename to src/main/resources/swagger.api/schemas/entity/consortiumItemCollection.yaml diff --git a/src/main/resources/swagger.api/schemas/contributor.yaml b/src/main/resources/swagger.api/schemas/entity/contributor.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/contributor.yaml rename to src/main/resources/swagger.api/schemas/entity/contributor.yaml diff --git a/src/main/resources/swagger.api/schemas/electronicAccess.yaml b/src/main/resources/swagger.api/schemas/entity/electronicAccess.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/electronicAccess.yaml rename to src/main/resources/swagger.api/schemas/entity/electronicAccess.yaml diff --git a/src/main/resources/swagger.api/schemas/error.yaml b/src/main/resources/swagger.api/schemas/entity/error.yaml similarity index 87% rename from src/main/resources/swagger.api/schemas/error.yaml rename to src/main/resources/swagger.api/schemas/entity/error.yaml index ef0252761..af7f0a22e 100644 --- a/src/main/resources/swagger.api/schemas/error.yaml +++ b/src/main/resources/swagger.api/schemas/entity/error.yaml @@ -1,5 +1,4 @@ description: "An error" -$schema: "http://json-schema.org/draft-04/schema#" type: "object" properties: message: diff --git a/src/main/resources/swagger.api/schemas/response/facet.yaml b/src/main/resources/swagger.api/schemas/entity/facet.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/response/facet.yaml rename to src/main/resources/swagger.api/schemas/entity/facet.yaml diff --git a/src/main/resources/swagger.api/schemas/response/facetItem.yaml b/src/main/resources/swagger.api/schemas/entity/facetItem.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/response/facetItem.yaml rename to src/main/resources/swagger.api/schemas/entity/facetItem.yaml diff --git a/src/main/resources/swagger.api/schemas/response/facetItems.yaml b/src/main/resources/swagger.api/schemas/entity/facetItems.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/response/facetItems.yaml rename to src/main/resources/swagger.api/schemas/entity/facetItems.yaml diff --git a/src/main/resources/swagger.api/schemas/featureConfig.yaml b/src/main/resources/swagger.api/schemas/entity/featureConfig.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/featureConfig.yaml rename to src/main/resources/swagger.api/schemas/entity/featureConfig.yaml diff --git a/src/main/resources/swagger.api/schemas/featureConfigs.yaml b/src/main/resources/swagger.api/schemas/entity/featureConfigs.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/featureConfigs.yaml rename to src/main/resources/swagger.api/schemas/entity/featureConfigs.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/holding.yaml b/src/main/resources/swagger.api/schemas/entity/holding.yaml new file mode 100644 index 000000000..11da1d348 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/holding.yaml @@ -0,0 +1,70 @@ +description: "Holding description" +type: object +properties: + id: + type: string + description: "Unique ID of the holding record" + tenantId: + description: "Tenant ID" + type: string + permanentLocationId: + type: string + description: "The permanent shelving location in which an item resides." + discoverySuppress: + type: boolean + description: "Indicates that the record should not be displayed in a discovery system" + hrid: + type: string + description: "the human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" + sourceId: + description: "(A reference to) the source of a holdings record" + type: string + formerIds: + type: array + description: "Previous identifiers assigned to the holding" + items: + type: string + statisticalCodeIds: + type: array + description: "List of statistical code IDs" + items: + type: string + description: "UUID for a statistical code" + tags: + description: "arbitrary tags associated with this holding" + $ref: "tags.yaml" + holdingsTypeId: + type: string + description: "unique ID for the type of this holdings record, a UUID" + callNumberPrefix: + type: string + description: "Prefix of the call number on the holding level." + callNumber: + type: string + description: "Call Number is an identifier assigned to an item, usually printed on a label attached to the item." + callNumberSuffix: + type: string + description: "Suffix of the call number on the holding level." + copyNumber: + type: string + description: "Item/Piece ID (usually barcode) for systems that do not use item records." + electronicAccess: + type: array + description: "List of electronic access items" + items: + $ref: "electronicAccess.yaml" + administrativeNotes: + type: array + description: "Administrative notes" + items: + type: string + notes: + type: array + description: "Notes about action, copy, binding etc." + items: + $ref: "note.yaml" + metadata: + $ref: "metadata.yaml" +required: + - electronicAccess + - notes diff --git a/src/main/resources/swagger.api/schemas/identifiers.yaml b/src/main/resources/swagger.api/schemas/entity/identifiers.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/identifiers.yaml rename to src/main/resources/swagger.api/schemas/entity/identifiers.yaml diff --git a/src/main/resources/swagger.api/schemas/indexDynamicSettings.yaml b/src/main/resources/swagger.api/schemas/entity/indexDynamicSettings.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/indexDynamicSettings.yaml rename to src/main/resources/swagger.api/schemas/entity/indexDynamicSettings.yaml diff --git a/src/main/resources/swagger.api/schemas/indexSettings.yaml b/src/main/resources/swagger.api/schemas/entity/indexSettings.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/indexSettings.yaml rename to src/main/resources/swagger.api/schemas/entity/indexSettings.yaml diff --git a/src/main/resources/swagger.api/schemas/instance.yaml b/src/main/resources/swagger.api/schemas/entity/instance.yaml similarity index 97% rename from src/main/resources/swagger.api/schemas/instance.yaml rename to src/main/resources/swagger.api/schemas/entity/instance.yaml index 4f39afa48..0975620eb 100644 --- a/src/main/resources/swagger.api/schemas/instance.yaml +++ b/src/main/resources/swagger.api/schemas/entity/instance.yaml @@ -125,22 +125,22 @@ properties: description: "List of electronic access items" type: array items: - $ref: "electronicAccess.json" + $ref: "electronicAccess.yaml" notes: description: "Bibliographic notes (e.g. general notes, specialized notes), and administrative notes" type: array items: - $ref: "note.json" + $ref: "note.yaml" items: description: "List of instance items" type: array items: - $ref: "item.json" + $ref: "item.yaml" holdings: description: "List of instance holding records" type: array items: - $ref: "holding.json" + $ref: "holding.yaml" required: - electronicAccess - notes diff --git a/src/main/resources/swagger.api/schemas/entity/item.yaml b/src/main/resources/swagger.api/schemas/entity/item.yaml new file mode 100644 index 000000000..1ac47d3f7 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/item.yaml @@ -0,0 +1,100 @@ +description: "Item description" +type: object +properties: + id: + type: string + description: "Unique ID of the item record" + tenantId: + description: "Tenant ID" + type: string + holdingsRecordId: + description: "Holdings record ID" + type: string + hrid: + type: string + description: "The human readable ID, also called eye readable ID. A system-assigned sequential alternate ID" + accessionNumber: + type: string + description: "Also called inventory number" + formerIds: + type: array + description: "Previous identifiers assigned to the item" + items: + type: string + itemIdentifier: + type: string + description: "Item identifier number, e.g. imported from the union catalogue (read only)." + barcode: + type: string + description: "Unique inventory control number for physical resources, used largely for circulation purposes" + effectiveLocationId: + type: string + description: "Read only current home location for the item." + status: + description: "The status of the item" + type: object + properties: + name: + description: "Name of the status e.g. Available, Checked out, In transit" + type: string + materialTypeId: + type: string + description: "Material type, term. Define what type of thing the item is." + discoverySuppress: + type: boolean + description: "Records the fact that the record should not be displayed in a discovery system" + effectiveCallNumberComponents: + type: object + description: "Elements of a full call number generated from the item or holding" + properties: + callNumber: + type: string + description: "Effective Call Number is an identifier assigned to an item or its holding and associated with the item." + prefix: + type: string + description: "Effective Call Number Prefix is the prefix of the identifier assigned to an item or its holding and associated with the item." + suffix: + type: string + description: "Effective Call Number Suffix is the suffix of the identifier assigned to an item or its holding and associated with the item." + typeId: + type: string + description: "Effective Call Number Type Id is the call number type id of the item, if available, otherwise that of the holding." + effectiveShelvingOrder: + type: string + description: "A system generated normalization of the call number that allows for call number sorting in reports and search results" + itemLevelCallNumberTypeId: + type: string + description: "Call number type id" + tags: + description: "arbitrary tags associated with this item" + $ref: 'tags.yaml' + electronicAccess: + type: array + description: "List of electronic access items" + items: + $ref: "electronicAccess.yaml" + administrativeNotes: + type: array + description: "Administrative notes" + items: + type: string + notes: + type: array + description: "Notes about action, copy, binding etc." + items: + $ref: "note.yaml" + statisticalCodeIds: + type: array + description: "List of statistical code IDs" + items: + type: string + description: "UUID for a statistical code" + circulationNotes: + type: array + description: "Notes to be displayed in circulation processes." + items: + $ref: "circulationNote.yaml" + metadata: + $ref: "metadata.yaml" +required: + - notes diff --git a/src/main/resources/swagger.api/schemas/languageConfig.yaml b/src/main/resources/swagger.api/schemas/entity/languageConfig.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/languageConfig.yaml rename to src/main/resources/swagger.api/schemas/entity/languageConfig.yaml diff --git a/src/main/resources/swagger.api/schemas/languageConfigs.yaml b/src/main/resources/swagger.api/schemas/entity/languageConfigs.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/languageConfigs.yaml rename to src/main/resources/swagger.api/schemas/entity/languageConfigs.yaml diff --git a/src/main/resources/swagger.api/schemas/metadata.yaml b/src/main/resources/swagger.api/schemas/entity/metadata.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/metadata.yaml rename to src/main/resources/swagger.api/schemas/entity/metadata.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/note.yaml b/src/main/resources/swagger.api/schemas/entity/note.yaml new file mode 100644 index 000000000..f8c7560d2 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/note.yaml @@ -0,0 +1,10 @@ +description: "Bibliographic or administrative note for instance/item/holding" +type: object +properties: + note: + type: string + description: "Text content of the note" + staffOnly: + type: boolean + description: "If true, determines that the note should not be visible for others than staff" + default: false diff --git a/src/main/resources/swagger.api/schemas/parameter.yaml b/src/main/resources/swagger.api/schemas/entity/parameter.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/parameter.yaml rename to src/main/resources/swagger.api/schemas/entity/parameter.yaml diff --git a/src/main/resources/swagger.api/schemas/parameters.yaml b/src/main/resources/swagger.api/schemas/entity/parameters.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/parameters.yaml rename to src/main/resources/swagger.api/schemas/entity/parameters.yaml diff --git a/src/main/resources/swagger.api/schemas/reindexJob.yaml b/src/main/resources/swagger.api/schemas/entity/reindexJob.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/reindexJob.yaml rename to src/main/resources/swagger.api/schemas/entity/reindexJob.yaml diff --git a/src/main/resources/swagger.api/schemas/response/resourceIds.yaml b/src/main/resources/swagger.api/schemas/entity/resouceIds.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/response/resourceIds.yaml rename to src/main/resources/swagger.api/schemas/entity/resouceIds.yaml diff --git a/src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.yaml b/src/main/resources/swagger.api/schemas/entity/resourceDeleteEventSubType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceDeleteEventSubType.yaml diff --git a/src/main/resources/swagger.api/schemas/resourceEvent.yaml b/src/main/resources/swagger.api/schemas/entity/resourceEvent.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/resourceEvent.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceEvent.yaml diff --git a/src/main/resources/swagger.api/schemas/resourceEventType.yaml b/src/main/resources/swagger.api/schemas/entity/resourceEventType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/resourceEventType.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceEventType.yaml diff --git a/src/main/resources/swagger.api/schemas/response/resourceId.yaml b/src/main/resources/swagger.api/schemas/entity/resourceId.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/response/resourceId.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceId.yaml diff --git a/src/main/resources/swagger.api/schemas/resourceIdsJob.yaml b/src/main/resources/swagger.api/schemas/entity/resourceIdsJob.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/resourceIdsJob.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceIdsJob.yaml diff --git a/src/main/resources/swagger.api/schemas/seriesItem.yaml b/src/main/resources/swagger.api/schemas/entity/seriesItem.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/seriesItem.yaml rename to src/main/resources/swagger.api/schemas/entity/seriesItem.yaml diff --git a/src/main/resources/swagger.api/schemas/shelvingOrderAlgorithmType.yaml b/src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/shelvingOrderAlgorithmType.yaml rename to src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/sortOrder.yaml b/src/main/resources/swagger.api/schemas/entity/sortOrder.yaml new file mode 100644 index 000000000..588a15a3e --- /dev/null +++ b/src/main/resources/swagger.api/schemas/entity/sortOrder.yaml @@ -0,0 +1,4 @@ +type: string +enum: + - asc + - desc diff --git a/src/main/resources/swagger.api/schemas/subject.yaml b/src/main/resources/swagger.api/schemas/entity/subject.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/subject.yaml rename to src/main/resources/swagger.api/schemas/entity/subject.yaml diff --git a/src/main/resources/swagger.api/schemas/tags.yaml b/src/main/resources/swagger.api/schemas/entity/tags.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/tags.yaml rename to src/main/resources/swagger.api/schemas/entity/tags.yaml diff --git a/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.yaml b/src/main/resources/swagger.api/schemas/entity/tenantConfiguredFeature.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/tenantConfiguredFeature.yaml rename to src/main/resources/swagger.api/schemas/entity/tenantConfiguredFeature.yaml diff --git a/src/main/resources/swagger.api/schemas/error.json b/src/main/resources/swagger.api/schemas/error.json deleted file mode 100644 index f5b49aba2..000000000 --- a/src/main/resources/swagger.api/schemas/error.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "An error", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "Error message text" - }, - "type": { - "type": "string", - "description": "Error message type" - }, - "code": { - "type": "string", - "description": "Error message code" - }, - "parameters": { - "type": "object", - "description": "Error message parameters", - "$ref": "parameters.json" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/errors.json b/src/main/resources/swagger.api/schemas/errors.json deleted file mode 100644 index f8ff6f5dd..000000000 --- a/src/main/resources/swagger.api/schemas/errors.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "A set of errors", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "errors": { - "description": "List of errors", - "id": "errors", - "type": "array", - "items": { - "type": "object", - "$ref": "error.json" - } - }, - "total_records": { - "description": "Total number of errors", - "type": "integer" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/featureConfig.json b/src/main/resources/swagger.api/schemas/featureConfig.json deleted file mode 100644 index b1e47d5bf..000000000 --- a/src/main/resources/swagger.api/schemas/featureConfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "description": "Feature config request value", - "properties": { - "feature": { - "description": "The feature name", - "$ref": "tenantConfiguredFeature.json" - }, - "enabled": { - "type": "boolean", - "description": "Action - enable or disable option" - } - }, - "additionalProperties": false, - "required": [ "feature", "enabled" ] -} - diff --git a/src/main/resources/swagger.api/schemas/featureConfigs.json b/src/main/resources/swagger.api/schemas/featureConfigs.json deleted file mode 100644 index 90dda0f12..000000000 --- a/src/main/resources/swagger.api/schemas/featureConfigs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "description": "Feature configs response per tenant", - "properties": { - "features": { - "type": "array", - "description": "Configured features per tenant", - "items": { - "$ref": "featureConfig.json" - } - }, - "totalRecords": { - "type": "integer", - "description": "Total records that matches the query.", - "minimum": 0 - } - } -} - diff --git a/src/main/resources/swagger.api/schemas/folioCreateIndexResponse.json b/src/main/resources/swagger.api/schemas/folioCreateIndexResponse.json deleted file mode 100644 index 3ffb3813d..000000000 --- a/src/main/resources/swagger.api/schemas/folioCreateIndexResponse.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Folio search create index response", - "properties": { - "errorMessage": { - "type": "string", - "description": "Error message with the reason why index was failed to create." - }, - "indices": { - "type": "array", - "description": "List of created elasticsearch indices.", - "minItems": 0, - "items": { - "description": "Create index name", - "type": "string" - } - }, - "status": { - "type": "string", - "description": "Index creation status - success or error.", - "enum": [ "success", "error" ] - } - }, - "additionalProperties": false -} diff --git a/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.json b/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.json deleted file mode 100644 index bc8334d6e..000000000 --- a/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Folio search create index response", - "properties": { - "errorMessage": { - "type": "string", - "description": "Error message with the reason why index was failed to create." - }, - "status": { - "type": "string", - "description": "Index creation status - success or error.", - "enum": [ "success", "error" ] - } - }, - "additionalProperties": false -} diff --git a/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.yaml b/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.yaml deleted file mode 100644 index 806a8edcf..000000000 --- a/src/main/resources/swagger.api/schemas/folioIndexOperationResponse.yaml +++ /dev/null @@ -1,13 +0,0 @@ -type: object -description: Folio search create index response -properties: - errorMessage: - type: string - description: Error message with the reason why index was failed to create. - status: - type: string - description: Index creation status - success or error. - enum: - - success - - error -additionalProperties: false diff --git a/src/main/resources/swagger.api/schemas/holding.json b/src/main/resources/swagger.api/schemas/holding.json deleted file mode 100644 index 33014c4f3..000000000 --- a/src/main/resources/swagger.api/schemas/holding.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Holding description", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the holding record" - }, - "tenantId": { - "description": "Tenant ID", - "type": "string" - }, - "permanentLocationId": { - "type": "string", - "description": "The permanent shelving location in which an item resides." - }, - "discoverySuppress": { - "type": "boolean", - "description": "Indicates that the record should not be displayed in a discovery system" - }, - "hrid": { - "type": "string", - "description": "the human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" - }, - "sourceId": { - "description": "(A reference to) the source of a holdings record", - "type": "string" - }, - "formerIds": { - "type": "array", - "description": "Previous identifiers assigned to the holding", - "items": { - "type": "string" - } - }, - "statisticalCodeIds": { - "type": "array", - "description": "List of statistical code IDs", - "items": { - "type": "string", - "description": "UUID for a statistical code" - } - }, - "tags": { - "description": "arbitrary tags associated with this holding", - "$ref": "tags.json" - }, - "holdingsTypeId": { - "type": "string", - "description": "unique ID for the type of this holdings record, a UUID" - }, - "callNumberPrefix": { - "type": "string", - "description": "Prefix of the call number on the holding level." - }, - "callNumber": { - "type": "string", - "description": "Call Number is an identifier assigned to an item, usually printed on a label attached to the item." - }, - "callNumberSuffix": { - "type": "string", - "description": "Suffix of the call number on the holding level." - }, - "copyNumber": { - "type": "string", - "description": "Item/Piece ID (usually barcode) for systems that do not use item records." - }, - "electronicAccess": { - "type": "array", - "description": "List of electronic access items", - "items": { - "$ref": "electronicAccess.json" - } - }, - "administrativeNotes": { - "type": "array", - "description": "Administrative notes", - "items": { - "type": "string" - } - }, - "notes": { - "type": "array", - "description": "Notes about action, copy, binding etc.", - "items": { - "$ref": "note.json" - } - }, - "metadata": { - "$ref": "metadata.json" - } - }, - "required": ["electronicAccess", "notes"] -} diff --git a/src/main/resources/swagger.api/schemas/identifiers.json b/src/main/resources/swagger.api/schemas/identifiers.json deleted file mode 100644 index 6bb4857ff..000000000 --- a/src/main/resources/swagger.api/schemas/identifiers.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource identifier", - "properties": { - "value": { - "type": "string", - "description": "Resource identifier value" - }, - "identifierTypeId": { - "type": "string", - "description": "Resource identifier type (e.g. Control number, LCCN, Other standard identifier, System control number)" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/indexDynamicSettings.json b/src/main/resources/swagger.api/schemas/indexDynamicSettings.json deleted file mode 100644 index b05635c30..000000000 --- a/src/main/resources/swagger.api/schemas/indexDynamicSettings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Elasticsearch/Opensearch index dynamic settings", - "type": "object", - "properties": { - "numberOfReplicas": { - "type": "integer", - "description": "The number of replicas each primary shard has.", - "minimum": 1, - "maximum": 100 - }, - "refreshInterval": { - "type": "integer", - "description": "How often to make new changes to the index visible to search (seconds). '-1' disables refresh.", - "minimum": -1, - "maximum": 3600 - } - } -} diff --git a/src/main/resources/swagger.api/schemas/indexSettings.json b/src/main/resources/swagger.api/schemas/indexSettings.json deleted file mode 100644 index 3695cbc7a..000000000 --- a/src/main/resources/swagger.api/schemas/indexSettings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Elasticsearch/Opensearch index settings", - "type": "object", - "properties": { - "numberOfShards": { - "type": "integer", - "description": "The number of primary shards that an index should have.", - "minimum": 1, - "maximum": 100 - }, - "numberOfReplicas": { - "type": "integer", - "description": "The number of replicas each primary shard has.", - "minimum": 1, - "maximum": 100 - }, - "refreshInterval": { - "type": "integer", - "description": "How often to make new changes to the index visible to search (seconds). '-1' disables refresh.", - "minimum": -1, - "maximum": 3600 - } - } -} diff --git a/src/main/resources/swagger.api/schemas/instance.json b/src/main/resources/swagger.api/schemas/instance.json deleted file mode 100644 index d0bdd05d1..000000000 --- a/src/main/resources/swagger.api/schemas/instance.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "instance description", - "properties": { - "id": { - "description": "The unique ID of the instance record; a UUID", - "type": "string" - }, - "tenantId": { - "description": "Tenant ID", - "type": "string" - }, - "shared": { - "description": "Indicate if it shared record", - "type": "boolean" - }, - "hrid": { - "type": "string", - "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" - }, - "source": { - "type": "string", - "description": "The metadata source and its format of the underlying record to the instance record. (e.g. FOLIO if it's a record created in Inventory; MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)" - }, - "statisticalCodeIds": { - "type": "array", - "description": "List of statistical code IDs", - "items": { - "type": "string", - "description": "UUID for a statistical code" - } - }, - "statusId": { - "type": "string", - "description": "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)" - }, - "title": { - "type": "string", - "description": "The primary title (or label) associated with the resource" - }, - "indexTitle": { - "type": "string", - "description": "Title normalized for browsing and searching; based on the title with articles removed" - }, - "series": { - "type": "array", - "description": "List of series titles associated with the resource (e.g. Harry Potter)", - "items": { - "$ref": "seriesItem.json" - } - }, - "alternativeTitles": { - "type": "array", - "description": "List of alternative titles for the resource (e.g. original language version title of a movie)", - "items": { - "$ref": "alternativeTitle.json" - } - }, - "identifiers": { - "type": "array", - "description": "Resource identifier value array", - "items": { - "$ref": "identifiers.json" - } - }, - "contributors": { - "type": "array", - "description": "List of contributors names", - "items": { - "$ref": "contributor.json" - } - }, - "subjects": { - "type": "array", - "description": "List of subject headings", - "items": { - "$ref": "subject.json" - } - }, - "instanceTypeId": { - "type": "string", - "description": "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined" - }, - "instanceFormatIds": { - "type": "array", - "description": "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined", - "items": { - "type": "string" - } - }, - "languages": { - "type": "array", - "description": "The set of languages used by the resource", - "items": { - "type": "string" - } - }, - "metadata": { - "$ref": "metadata.json" - }, - "administrativeNotes": { - "type": "array", - "description": "Administrative notes", - "items": { - "type": "string" - } - }, - "modeOfIssuanceId": { - "type": "string", - "description": "UUID of the RDA mode of issuance, a categorization reflecting whether a resource is issued in one or more parts, the way it is updated, and whether its termination is predetermined or not (e.g. monograph, sequential monograph, serial; integrating Resource, other)" - }, - "natureOfContentTermIds": { - "type": "array", - "description": "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)", - "items": { - "type": "string", - "description": "Single UUID for the Instance nature of content" - } - }, - "publication": { - "type": "array", - "description": "List of publication items", - "items": { - "type": "object", - "properties": { - "publisher": { - "type": "string", - "description": "Name of publisher, distributor, etc." - }, - "dateOfPublication": { - "type": "string", - "description": "Date (year YYYY) of publication, distribution, etc." - } - } - } - }, - "staffSuppress": { - "type": "boolean", - "description": "Records the fact that the record should not be displayed for others than catalogers" - }, - "discoverySuppress": { - "type": "boolean", - "description": "Records the fact that the record should not be displayed in a discovery system" - }, - "isBoundWith": { - "description": "Indicates if this instance is included in a bound-with", - "type": "boolean" - }, - "tags": { - "description": "arbitrary tags associated with this instance", - "$ref": "tags.json" - }, - "classifications": { - "type": "array", - "description": "List of classifications", - "items": { - "type": "object", - "properties": { - "classificationNumber": { - "type": "string", - "description": "Classification (e.g. classification scheme, classification schedule)" - }, - "classificationTypeId": { - "type": "string", - "description": "Classification type ID" - } - } - } - }, - "electronicAccess": { - "type": "array", - "description": "List of electronic access items", - "items": { - "$ref": "electronicAccess.json" - } - }, - "notes": { - "type": "array", - "description": "Bibliographic notes (e.g. general notes, specialized notes), and administrative notes", - "items": { - "$ref": "note.json" - } - }, - "items": { - "type": "array", - "description": "List of instance items", - "items": { - "$ref": "item.json" - } - }, - "holdings": { - "type": "array", - "description": "List of instance holding records", - "items": { - "$ref": "holding.json" - } - } - }, - "required": ["electronicAccess", "notes", "items", "holdings"] -} - diff --git a/src/main/resources/swagger.api/schemas/item.json b/src/main/resources/swagger.api/schemas/item.json deleted file mode 100644 index f7de452f5..000000000 --- a/src/main/resources/swagger.api/schemas/item.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Item description", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the item record" - }, - "tenantId": { - "description": "Tenant ID", - "type": "string" - }, - "holdingsRecordId": { - "description": "Holdings record ID", - "type": "string" - }, - "hrid": { - "type": "string", - "description": "The human readable ID, also called eye readable ID. A system-assigned sequential alternate ID" - }, - "accessionNumber": { - "type": "string", - "description": "Also called inventory number" - }, - "formerIds": { - "type": "array", - "description": "Previous identifiers assigned to the item", - "items": { - "type": "string" - } - }, - "itemIdentifier": { - "type": "string", - "description": "Item identifier number, e.g. imported from the union catalogue (read only)." - }, - "barcode": { - "type": "string", - "description": "Unique inventory control number for physical resources, used largely for circulation purposes" - }, - "effectiveLocationId": { - "type": "string", - "description": "Read only current home location for the item." - }, - "status": { - "description": "The status of the item", - "type": "object", - "properties": { - "name": { - "description": "Name of the status e.g. Available, Checked out, In transit", - "type": "string" - } - } - }, - "materialTypeId": { - "type": "string", - "description": "Material type, term. Define what type of thing the item is." - }, - "discoverySuppress": { - "type": "boolean", - "description": "Records the fact that the record should not be displayed in a discovery system" - }, - "effectiveCallNumberComponents": { - "type": "object", - "description": "Elements of a full call number generated from the item or holding", - "properties": { - "callNumber": { - "type": "string", - "description": "Effective Call Number is an identifier assigned to an item or its holding and associated with the item." - }, - "prefix": { - "type": "string", - "description": "Effective Call Number Prefix is the prefix of the identifier assigned to an item or its holding and associated with the item." - }, - "suffix": { - "type": "string", - "description": "Effective Call Number Suffix is the suffix of the identifier assigned to an item or its holding and associated with the item." - }, - "typeId": { - "type": "string", - "description": "Effective Call Number Type Id is the call number type id of the item, if available, otherwise that of the holding." - } - } - }, - "effectiveShelvingOrder": { - "type": "string", - "description": "A system generated normalization of the call number that allows for call number sorting in reports and search results" - }, - "itemLevelCallNumberTypeId": { - "type": "string", - "description": "Call number type id" - }, - "tags": { - "description": "arbitrary tags associated with this item", - "$ref": "tags.json" - }, - "electronicAccess": { - "type": "array", - "description": "List of electronic access items", - "items": { - "$ref": "electronicAccess.json" - } - }, - "administrativeNotes": { - "type": "array", - "description": "Administrative notes", - "items": { - "type": "string" - } - }, - "notes": { - "type": "array", - "description": "Notes about action, copy, binding etc.", - "items": { - "$ref": "note.json" - } - }, - "statisticalCodeIds": { - "type": "array", - "description": "List of statistical code IDs", - "items": { - "type": "string", - "description": "UUID for a statistical code" - } - }, - "circulationNotes": { - "type": "array", - "description": "Notes to be displayed in circulation processes.", - "items": { - "$ref": "circulationNote.json" - } - }, - "metadata": { - "$ref": "metadata.json" - } - }, - "required": ["notes"] -} diff --git a/src/main/resources/swagger.api/schemas/languageConfig.json b/src/main/resources/swagger.api/schemas/languageConfig.json deleted file mode 100644 index c8428e353..000000000 --- a/src/main/resources/swagger.api/schemas/languageConfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "description": "Language config", - "properties": { - "code": { - "type": "string", - "description": "An ISO-639-2/B compatible language code.", - "pattern": "[a-zA-Z]{3}" - }, - "languageAnalyzer": { - "type": "string", - "description": "Custom elasticsearch analyzer for language." - } - }, - "additionalProperties": false, - "required": ["code"] -} - diff --git a/src/main/resources/swagger.api/schemas/languageConfigs.json b/src/main/resources/swagger.api/schemas/languageConfigs.json deleted file mode 100644 index ef0948d81..000000000 --- a/src/main/resources/swagger.api/schemas/languageConfigs.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "description": "Language config", - "properties": { - "languageConfigs": { - "type": "array", - "description": "Configured languages for a tenant", - "items": { - "$ref": "languageConfig.json" - } - }, - "totalRecords": { - "type": "integer", - "description": "Total records that matches the query.", - "minimum": 0 - } - }, - "additionalProperties": false, - "required": [ - "languageConfigs", - "totalRecords" - ] -} - diff --git a/src/main/resources/swagger.api/schemas/metadata.json b/src/main/resources/swagger.api/schemas/metadata.json deleted file mode 100644 index 80640055a..000000000 --- a/src/main/resources/swagger.api/schemas/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Record metadata", - "properties": { - "createdDate": { - "description": "Date and time when the record was created", - "type": "string" - }, - "createdByUserId": { - "description": "ID of the user who created the record (when available)", - "type": "string" - }, - "createdByUsername": { - "description": "Username of the user who created the record (when available)", - "type": "string" - }, - "updatedDate": { - "description": "Date and time when the record was last updated", - "type": "string" - }, - "updatedByUserId": { - "description": "ID of the user who last updated the record (when available)", - "type": "string" - }, - "updatedByUsername": { - "description": "Username of the user who last updated the record (when available)", - "type": "string" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/note.json b/src/main/resources/swagger.api/schemas/note.json deleted file mode 100644 index 7a28895d7..000000000 --- a/src/main/resources/swagger.api/schemas/note.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Bibliographic or administrative note for instance/item/holding", - "type": "object", - "properties": { - "note": { - "type": "string", - "description": "Text content of the note" - }, - "staffOnly": { - "type": "boolean", - "description": "If true, determines that the note should not be visible for others than staff", - "default": false - } - } -} diff --git a/src/main/resources/swagger.api/schemas/parameter.json b/src/main/resources/swagger.api/schemas/parameter.json deleted file mode 100644 index bb7ee1e97..000000000 --- a/src/main/resources/swagger.api/schemas/parameter.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "List of key/value parameters of an error", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "key": { - "description": "Parameter key", - "type": "string" - }, - "value": { - "description": "Parameter value", - "type": "string" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/parameters.json b/src/main/resources/swagger.api/schemas/parameters.json deleted file mode 100644 index 117b24c09..000000000 --- a/src/main/resources/swagger.api/schemas/parameters.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "description": "List of key/value parameters of an error", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "array", - "items": { - "type": "object", - "$ref": "parameter.json" - } -} diff --git a/src/main/resources/swagger.api/schemas/reindexJob.json b/src/main/resources/swagger.api/schemas/reindexJob.json deleted file mode 100644 index 835582dd3..000000000 --- a/src/main/resources/swagger.api/schemas/reindexJob.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Get job by id response", - "type": "object", - "properties": { - "id": { - "description": "Job id", - "type": "string" - }, - "jobStatus": { - "description": "Overall job status", - "type": "string" - }, - "submittedDate": { - "description": "Timestamp when the job has been submitted", - "type": "string" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/request/createIndexRequest.json b/src/main/resources/swagger.api/schemas/request/createIndexRequest.json deleted file mode 100644 index 288185e49..000000000 --- a/src/main/resources/swagger.api/schemas/request/createIndexRequest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Request body to create Elasticsearch index", - "properties": { - "resourceName": { - "type": "string", - "description": "Name of resource" - } - }, - "additionalProperties": false, - "required": [ "resourceName" ] -} diff --git a/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml b/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml index 32a1338cb..ea41b4569 100644 --- a/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml +++ b/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml @@ -1,3 +1,4 @@ type: array items: - $ref: '../../schemas/resourceEvent.yaml' + type: object + $ref: '../entity/resourceEvent.yaml' diff --git a/src/main/resources/swagger.api/schemas/request/reindexRequest.json b/src/main/resources/swagger.api/schemas/request/reindexRequest.json deleted file mode 100644 index c71a241b8..000000000 --- a/src/main/resources/swagger.api/schemas/request/reindexRequest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Reindex Request body", - "type": "object", - "properties": { - "recreateIndex": { - "type": "boolean", - "default": false, - "description": "Boolean parameter, if set to true - tenant index must be recreated before reindex operation" - }, - "resourceName": { - "type": "string", - "description": "Resource name to run reindex for", - "default": "instance" - }, - "indexSettings": { - "description": "Index settings to apply for index", - "$ref": "../indexSettings.json" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/request/reindexRequest.yaml b/src/main/resources/swagger.api/schemas/request/reindexRequest.yaml index 856995702..c468f3d12 100644 --- a/src/main/resources/swagger.api/schemas/request/reindexRequest.yaml +++ b/src/main/resources/swagger.api/schemas/request/reindexRequest.yaml @@ -11,4 +11,4 @@ properties: default: instance indexSettings: description: Index settings to apply for index - $ref: "../indexSettings.yaml" + $ref: "../../schemas/entity/indexSettings.yaml" diff --git a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.json b/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.json deleted file mode 100644 index 748428b50..000000000 --- a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Update Index Settings request body", - "type": "object", - "properties": { - "resourceName": { - "type": "string", - "description": "Resource name to set index Settings" - }, - "indexSettings": { - "description": "Index settings to apply for index", - "$ref": "../indexDynamicSettings.json" - } - }, - "required": ["resourceName"] -} diff --git a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml b/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml index ab7b0a207..b14529ec2 100644 --- a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml +++ b/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml @@ -6,6 +6,6 @@ properties: description: Resource name to set index Settings indexSettings: description: Index settings to apply for index - $ref: "../indexDynamicSettings.yaml" + $ref: "../../schemas/entity/indexDynamicSettings.yaml" required: - resourceName diff --git a/src/main/resources/swagger.api/schemas/request/updateMappingsRequest.json b/src/main/resources/swagger.api/schemas/request/updateMappingsRequest.json deleted file mode 100644 index b4148c7df..000000000 --- a/src/main/resources/swagger.api/schemas/request/updateMappingsRequest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Request to create resource mappings in Elasticsearch", - "properties": { - "resourceName": { - "type": "string", - "description": "Name of resource" - } - }, - "additionalProperties": false, - "required": [ "resourceName" ] -} diff --git a/src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.json b/src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.json deleted file mode 100644 index 9df3a749c..000000000 --- a/src/main/resources/swagger.api/schemas/resourceDeleteEventSubType.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "string", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource event delete operation type - one of [soft-delete, hard-delete]", - "enum": [ "SOFT_DELETE", "HARD_DELETE"] -} diff --git a/src/main/resources/swagger.api/schemas/resourceEvent.json b/src/main/resources/swagger.api/schemas/resourceEvent.json deleted file mode 100644 index 3579171ba..000000000 --- a/src/main/resources/swagger.api/schemas/resourceEvent.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource event body", - "properties": { - "id": { - "description": "Resource id", - "type": "string" - }, - "type": { - "description": "Resource event operation type", - "$ref": "resourceEventType.json" - }, - "deleteEventSubType": { - "description": "Resource event delete operation type", - "$ref": "resourceDeleteEventSubType.json" - }, - "tenant": { - "description": "Tenant id", - "type": "string" - }, - "resourceName": { - "description": "Name of resource", - "type": "string" - }, - "new": { - "description": "Instance record new fields", - "type": "object" - }, - "old": { - "description": "Instance record old fields", - "type": "object" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/resourceEventType.json b/src/main/resources/swagger.api/schemas/resourceEventType.json deleted file mode 100644 index 107d76480..000000000 --- a/src/main/resources/swagger.api/schemas/resourceEventType.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "string", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource event operation type - one of [update, create, delete, delete_all, reindex]", - "enum": [ "UPDATE", "CREATE", "DELETE", "REINDEX", "DELETE_ALL" ] -} diff --git a/src/main/resources/swagger.api/schemas/resourceIdsJob.json b/src/main/resources/swagger.api/schemas/resourceIdsJob.json deleted file mode 100644 index 4f557433e..000000000 --- a/src/main/resources/swagger.api/schemas/resourceIdsJob.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Job for the stream of entity ids.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID for the job record." - }, - "query": { - "type": "string", - "description": "CQL query for getting ids." - }, - "status": { - "type": "string", - "description": "Ids streaming status.", - "enum": [ - "IN_PROGRESS", - "ERROR", - "COMPLETED", - "DEPRECATED" - ] - }, - "entityType": { - "type": "string", - "description": "Type of entity for streaming ids.", - "enum": [ - "INSTANCE", - "AUTHORITY", - "HOLDINGS" - ] - }, - "createdDate": { - "description": "Date and time when the record was created.", - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "query", - "entityType" - ] -} diff --git a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.json b/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.json deleted file mode 100644 index b56523e76..000000000 --- a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Call-number browse search result item", - "type": "object", - "properties": { - "authority": { - "description": "Related authority object", - "$ref": "../authority.json" - }, - "headingRef": { - "type": "string", - "description": "The heading/reference of the record that provides authority information for authority browse item" - }, - "isAnchor": { - "type": "boolean", - "description": "Marks if current value is anchor or not" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml b/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml index e4da7360c..f8d591147 100644 --- a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml +++ b/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml @@ -3,7 +3,7 @@ type: object properties: authority: description: Related authority object - $ref: ../authority.yaml + $ref: '../../schemas/entity/authority.yaml' headingRef: type: string description: The heading/reference of the record that provides authority information for authority browse item diff --git a/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.json b/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.json deleted file mode 100644 index f953561a8..000000000 --- a/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Authority browse search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of items to display" - }, - "prev": { - "type": "string", - "description": "Previous value for browsing backward" - }, - "next": { - "type": "string", - "description": "Next value for browsing forward" - }, - "items": { - "type": "array", - "description": "List of authority browse items", - "items": { - "$ref": "authorityBrowseItem.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.yaml b/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.yaml index 6e2e99c3b..70e1e3b86 100644 --- a/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.yaml +++ b/src/main/resources/swagger.api/schemas/response/authorityBrowseResult.yaml @@ -14,4 +14,4 @@ properties: type: array description: List of authority browse items items: - $ref: authorityBrowseItem.yaml + $ref: 'authorityBrowseItem.yaml' diff --git a/src/main/resources/swagger.api/schemas/response/authoritySearchResult.json b/src/main/resources/swagger.api/schemas/response/authoritySearchResult.json deleted file mode 100644 index 235b360eb..000000000 --- a/src/main/resources/swagger.api/schemas/response/authoritySearchResult.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Authority search result response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of authorities found" - }, - "authorities": { - "type": "array", - "description": "List of authorities found", - "items": { - "$ref": "../authority.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/authoritySearchResult.yaml b/src/main/resources/swagger.api/schemas/response/authoritySearchResult.yaml index 84026d675..c01be8e9a 100644 --- a/src/main/resources/swagger.api/schemas/response/authoritySearchResult.yaml +++ b/src/main/resources/swagger.api/schemas/response/authoritySearchResult.yaml @@ -8,4 +8,4 @@ properties: type: "array" description: "List of authorities found" items: - $ref: "../authority.yaml" + $ref: "../../schemas/entity/authority.yaml" diff --git a/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.json b/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.json deleted file mode 100644 index f01fc0b42..000000000 --- a/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Call-number browse search result item", - "type": "object", - "properties": { - "fullCallNumber": { - "type": "string", - "description": "Full call number value to display" - }, - "shelfKey": { - "type": "string", - "description": "Shelf key value to be used for browsing" - }, - "isAnchor": { - "type": "boolean", - "description": "Marks if current value is anchor or not" - }, - "totalRecords": { - "type": "integer", - "description": "Amount of records for the call number value" - }, - "instance": { - "description": "Related instance object", - "$ref": "../instance.json" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.yaml b/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.yaml index 9b3bbe238..2cfbdd2f8 100644 --- a/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.yaml +++ b/src/main/resources/swagger.api/schemas/response/callNumberBrowseItem.yaml @@ -15,4 +15,4 @@ properties: description: Amount of records for the call number value instance: description: Related instance object - $ref: "../instance.yaml" + $ref: "../../schemas/entity/instance.yaml" diff --git a/src/main/resources/swagger.api/schemas/response/callNumberBrowseResult.json b/src/main/resources/swagger.api/schemas/response/callNumberBrowseResult.json deleted file mode 100644 index 505b88461..000000000 --- a/src/main/resources/swagger.api/schemas/response/callNumberBrowseResult.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Call number browse search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of items to display" - }, - "prev": { - "type": "string", - "description": "Previous value for browsing backward" - }, - "next": { - "type": "string", - "description": "Next value for browsing forward" - }, - "items": { - "type": "array", - "description": "List of call number browse items", - "items": { - "$ref": "callNumberBrowseItem.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseItem.json b/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseItem.json deleted file mode 100644 index 071958581..000000000 --- a/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseItem.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Classification number browse search result item", - "type": "object", - "properties": { - "classificationNumber": { - "type": "string", - "description": "Classification number value to display" - }, - "classificationTypeId": { - "type": "string", - "description": "Classification type ID value" - }, - "isAnchor": { - "type": "boolean", - "description": "Marks if current value is anchor or not" - }, - "totalRecords": { - "type": "integer", - "description": "Amount of records for the classification number value" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseResult.json b/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseResult.json deleted file mode 100644 index 8eb4c1774..000000000 --- a/src/main/resources/swagger.api/schemas/response/classificationNumberBrowseResult.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Classification number browse search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of items to display" - }, - "prev": { - "type": "string", - "description": "Previous value for browsing backward" - }, - "next": { - "type": "string", - "description": "Next value for browsing forward" - }, - "items": { - "type": "array", - "description": "List of classification number browse items", - "items": { - "$ref": "classificationNumberBrowseItem.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.yaml b/src/main/resources/swagger.api/schemas/response/contributorBrowseResult.yaml similarity index 89% rename from src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.yaml rename to src/main/resources/swagger.api/schemas/response/contributorBrowseResult.yaml index 53288d527..b6cbefc8f 100644 --- a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.yaml +++ b/src/main/resources/swagger.api/schemas/response/contributorBrowseResult.yaml @@ -14,4 +14,4 @@ properties: type: array description: List of instance contributor browse items items: - $ref: instanceContributorBrowseItem.yaml + $ref: 'instanceContributorBrowseItem.yaml' diff --git a/src/main/resources/swagger.api/schemas/errors.yaml b/src/main/resources/swagger.api/schemas/response/errorResponse.yaml similarity index 87% rename from src/main/resources/swagger.api/schemas/errors.yaml rename to src/main/resources/swagger.api/schemas/response/errorResponse.yaml index 2557170bd..d33b1ec9f 100644 --- a/src/main/resources/swagger.api/schemas/errors.yaml +++ b/src/main/resources/swagger.api/schemas/response/errorResponse.yaml @@ -7,7 +7,7 @@ properties: type: "array" items: type: "object" - $ref: "./error.yaml" + $ref: "../entity/error.yaml" total_records: description: "Total number of errors" type: "integer" diff --git a/src/main/resources/swagger.api/schemas/response/facet.json b/src/main/resources/swagger.api/schemas/response/facet.json deleted file mode 100644 index a11906c0b..000000000 --- a/src/main/resources/swagger.api/schemas/response/facet.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Result value for specific facet", - "type": "object", - "properties": { - "values": { - "description": "Facet items", - "$ref": "facetItems.json" - }, - "totalRecords": { - "type": "integer", - "description": "Amount of facet items" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/facetItem.json b/src/main/resources/swagger.api/schemas/response/facetItem.json deleted file mode 100644 index 8a46399f5..000000000 --- a/src/main/resources/swagger.api/schemas/response/facetItem.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "description": "Facet item description", - "properties": { - "id": { - "type": "string", - "description": "Facet value" - }, - "totalRecords": { - "type": "number", - "description": "Amount of search results for that facet" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/facetItems.json b/src/main/resources/swagger.api/schemas/response/facetItems.json deleted file mode 100644 index 36ad1c542..000000000 --- a/src/main/resources/swagger.api/schemas/response/facetItems.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "JSON schema for facet items", - "type": "array", - "items": { - "$ref": "facetItem.json" - } -} diff --git a/src/main/resources/swagger.api/schemas/response/facetResult.json b/src/main/resources/swagger.api/schemas/response/facetResult.json deleted file mode 100644 index 0fde71f08..000000000 --- a/src/main/resources/swagger.api/schemas/response/facetResult.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Facet result response", - "type": "object", - "properties": { - "facets": { - "description": "Map with found facet items, key is the facet name, value - facet object with found values", - "type": "object", - "additionalProperties": { - "$ref": "facet.json" - } - }, - "totalRecords": { - "type": "integer", - "description": "Amount of facets found" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/facetResult.yaml b/src/main/resources/swagger.api/schemas/response/facetResult.yaml similarity index 86% rename from src/main/resources/swagger.api/schemas/facetResult.yaml rename to src/main/resources/swagger.api/schemas/response/facetResult.yaml index 34bb09175..ee27128bd 100644 --- a/src/main/resources/swagger.api/schemas/facetResult.yaml +++ b/src/main/resources/swagger.api/schemas/response/facetResult.yaml @@ -5,7 +5,7 @@ properties: description: "Map with found facet items, key is the facet name, value - facet object with found values" type: "object" additionalProperties: - $ref: "../schemas/response/facet.yaml" + $ref: "../../schemas/entity/facet.yaml" totalRecords: type: "integer" description: "Amount of facets found" diff --git a/src/main/resources/swagger.api/schemas/folioCreateIndexResponse.yaml b/src/main/resources/swagger.api/schemas/response/folioCreateIndexResponse.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/folioCreateIndexResponse.yaml rename to src/main/resources/swagger.api/schemas/response/folioCreateIndexResponse.yaml diff --git a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseItem.json b/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseItem.json deleted file mode 100644 index c52445512..000000000 --- a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseItem.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Instance contributor browse search result item", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Personal name, corporate name, meeting name" - }, - "contributorTypeId": { - "type": "array", - "description": "IDs for the contributor type term", - "items": { - "type": "string", - "description": "ID for the contributor type term" - } - }, - "contributorNameTypeId": { - "type": "string", - "description": "Contributor type terms defined by the MARC code list for relators" - }, - "authorityId": { - "type": "string", - "description": "ID of authority record that controls the contributor" - }, - "isAnchor": { - "type": "boolean", - "description": "Marks if current value is anchor or not" - }, - "totalRecords": { - "type": "integer", - "description": "Amount of records for the subject browse item" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.json b/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.json deleted file mode 100644 index 5388030d3..000000000 --- a/src/main/resources/swagger.api/schemas/response/instanceContributorBrowseResult.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Instance contributor browse search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of items to display" - }, - "prev": { - "type": "string", - "description": "Previous value for browsing backward" - }, - "next": { - "type": "string", - "description": "Next value for browsing forward" - }, - "items": { - "type": "array", - "description": "List of instance contributor browse items", - "items": { - "$ref": "instanceContributorBrowseItem.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/instanceSearchResult.json b/src/main/resources/swagger.api/schemas/response/instanceSearchResult.json deleted file mode 100644 index be4616ce8..000000000 --- a/src/main/resources/swagger.api/schemas/response/instanceSearchResult.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Instance search result response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of instances found" - }, - "instances": { - "type": "array", - "description": "List of instances found", - "items": { - "$ref": "../instance.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/instanceSearchResult.yaml b/src/main/resources/swagger.api/schemas/response/instanceSearchResult.yaml index 991f3d28c..993886423 100644 --- a/src/main/resources/swagger.api/schemas/response/instanceSearchResult.yaml +++ b/src/main/resources/swagger.api/schemas/response/instanceSearchResult.yaml @@ -8,4 +8,4 @@ properties: type: "array" description: "List of instances found" items: - $ref: "../instance.yaml" + $ref: "../../schemas/entity/instance.yaml" diff --git a/src/main/resources/swagger.api/schemas/response/resourceId.json b/src/main/resources/swagger.api/schemas/response/resourceId.json deleted file mode 100644 index 54f20b1cd..000000000 --- a/src/main/resources/swagger.api/schemas/response/resourceId.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource Id", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Resource uuid" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/resourceIds.json b/src/main/resources/swagger.api/schemas/response/resourceIds.json deleted file mode 100644 index 13bbcb073..000000000 --- a/src/main/resources/swagger.api/schemas/response/resourceIds.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Resource ids as mod-search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of resource ids found" - }, - "ids": { - "type": "array", - "description": "List of resource ids", - "items": { - "$ref": "resourceId.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/subjectBrowseItem.json b/src/main/resources/swagger.api/schemas/response/subjectBrowseItem.json deleted file mode 100644 index 616f96b30..000000000 --- a/src/main/resources/swagger.api/schemas/response/subjectBrowseItem.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Subject browse search result item", - "type": "object", - "properties": { - "value": { - "type": "string", - "description": "Subject value to be used for browsing" - }, - "isAnchor": { - "type": "boolean", - "description": "Marks if current value is anchor or not" - }, - "totalRecords": { - "type": "integer", - "description": "Amount of records for the subject browse item" - }, - "authorityId": { - "type": "string", - "description": "ID of authority record that controls the subject" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/response/subjectBrowseResult.json b/src/main/resources/swagger.api/schemas/response/subjectBrowseResult.json deleted file mode 100644 index d7362ee64..000000000 --- a/src/main/resources/swagger.api/schemas/response/subjectBrowseResult.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Subject browse search response", - "type": "object", - "properties": { - "totalRecords": { - "type": "integer", - "description": "Amount of items to display" - }, - "prev": { - "type": "string", - "description": "Previous value for browsing backward" - }, - "next": { - "type": "string", - "description": "Next value for browsing forward" - }, - "items": { - "type": "array", - "description": "List of subject browse items", - "items": { - "$ref": "subjectBrowseItem.json" - } - } - } -} diff --git a/src/main/resources/swagger.api/schemas/seriesItem.json b/src/main/resources/swagger.api/schemas/seriesItem.json deleted file mode 100644 index 95bc8776a..000000000 --- a/src/main/resources/swagger.api/schemas/seriesItem.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "A series item description", - "properties": { - "value": { - "type": "string", - "description": "Series title value" - }, - "authorityId": { - "type": "string", - "description": "UUID of authority record that controls an series title" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/sortOrder.yaml b/src/main/resources/swagger.api/schemas/sortOrder.yaml deleted file mode 100644 index 7653796fb..000000000 --- a/src/main/resources/swagger.api/schemas/sortOrder.yaml +++ /dev/null @@ -1,5 +0,0 @@ -sortOrder: - type: string - enum: - - asc - - desc diff --git a/src/main/resources/swagger.api/schemas/subject.json b/src/main/resources/swagger.api/schemas/subject.json deleted file mode 100644 index fd85314c6..000000000 --- a/src/main/resources/swagger.api/schemas/subject.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "A subject heading description", - "properties": { - "value": { - "type": "string", - "description": "Subject heading value" - }, - "authorityId": { - "type": "string", - "description": "UUID of authority record that controls a subject heading" - } - } -} diff --git a/src/main/resources/swagger.api/schemas/tags.json b/src/main/resources/swagger.api/schemas/tags.json deleted file mode 100644 index 162fced47..000000000 --- a/src/main/resources/swagger.api/schemas/tags.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "tags.schema", - "title": "tags", - "description": "List of simple tags that can be added to an object", - "type": "object", - "properties": { - "tagList": { - "description": "List of tags", - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false -} diff --git a/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json b/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json deleted file mode 100644 index 1bccc2dae..000000000 --- a/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "string", - "description": "The feature name.", - "enum": [ - "search.all.fields", - "browse.cn.intermediate.values", - "browse.cn.intermediate.remove.duplicates", - "browse.classifications" - ] -} diff --git a/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java b/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java index dfba34280..4193f2d85 100644 --- a/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java +++ b/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java @@ -30,10 +30,10 @@ import java.util.stream.Stream; import lombok.extern.log4j.Log4j2; import org.folio.search.domain.dto.Contributor; +import org.folio.search.domain.dto.ContributorBrowseResult; import org.folio.search.domain.dto.Facet; import org.folio.search.domain.dto.FacetResult; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceContributorBrowseResult; import org.folio.search.domain.dto.RecordType; import org.folio.search.support.base.BaseConsortiumIntegrationTest; import org.folio.search.utils.SearchUtils; @@ -110,8 +110,8 @@ void browseByContributor_shared() { "(" + prepareQuery("name >= {value} or name < {value}", '"' + "Bon Jovi" + '"') + ") " + "and instances.shared==true").param("limit", "5"); - var actual = parseResponse(doGet(request), InstanceContributorBrowseResult.class); - var expected = new InstanceContributorBrowseResult().totalRecords(5).prev(null).next(null).items( + var actual = parseResponse(doGet(request), ContributorBrowseResult.class); + var expected = new ContributorBrowseResult().totalRecords(5).prev(null).next(null).items( List.of( contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[2]), @@ -131,8 +131,8 @@ void browseByContributor_local() { "(" + prepareQuery("name >= {value} or name < {value}", '"' + "Bon Jovi" + '"') + ") " + "and instances.shared==false").param("limit", "5"); - var actual = parseResponse(doGet(request), InstanceContributorBrowseResult.class); - var expected = new InstanceContributorBrowseResult().totalRecords(8).prev(null).next("John Lennon").items( + var actual = parseResponse(doGet(request), ContributorBrowseResult.class); + var expected = new ContributorBrowseResult().totalRecords(8).prev(null).next("John Lennon").items( List.of( contributorBrowseItem(1, true, "Bon Jovi", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[1], TYPE_IDS[2]), diff --git a/src/test/java/org/folio/search/controller/BrowseContributorIT.java b/src/test/java/org/folio/search/controller/BrowseContributorIT.java index 1e347216a..e386d41fc 100644 --- a/src/test/java/org/folio/search/controller/BrowseContributorIT.java +++ b/src/test/java/org/folio/search/controller/BrowseContributorIT.java @@ -26,10 +26,10 @@ import java.util.Map; import java.util.stream.Stream; import org.folio.search.domain.dto.Contributor; +import org.folio.search.domain.dto.ContributorBrowseResult; import org.folio.search.domain.dto.Facet; import org.folio.search.domain.dto.FacetResult; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceContributorBrowseResult; import org.folio.search.domain.dto.RecordType; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.SearchUtils; @@ -91,7 +91,7 @@ private static Stream contributorBrowsingDataProvider() { var backwardIncludingQuery = "name <= {value}"; return Stream.of(arguments(aroundQuery, "John", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Bon Jovi").next("John Lennon").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Bon Jovi").next("John Lennon").items(List.of( contributorBrowseItem(2, "Bon Jovi", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1], TYPE_IDS[2]), contributorBrowseItem(2, "George Harrison", NAME_TYPE_IDS[1], AUTHORITY_IDS[0], TYPE_IDS[2]), @@ -100,7 +100,7 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(1, "John Lennon", NAME_TYPE_IDS[2], null, TYPE_IDS[0])))), arguments(aroundQuery, "Lenon", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Klaus Meine").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Klaus Meine").next("Paul McCartney").items(List.of( contributorBrowseItem(2, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(1, "Klaus Meine", NAME_TYPE_IDS[1], AUTHORITY_IDS[0]), contributorBrowseItem(0, true, "Lenon"), @@ -108,7 +108,7 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(1, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[2])))), arguments(aroundIncludingQuery, "Meine", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Klaus Meine").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Klaus Meine").next("Paul McCartney").items(List.of( contributorBrowseItem(2, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(1, "Klaus Meine", NAME_TYPE_IDS[1], AUTHORITY_IDS[0]), contributorBrowseItem(0, true, "Meine"), @@ -116,7 +116,7 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(1, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[2])))), arguments(aroundIncludingQuery, "Klaus Meine", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( contributorBrowseItem(1, "John Lennon", NAME_TYPE_IDS[2], null, TYPE_IDS[0]), contributorBrowseItem(2, "John Lennon", NAME_TYPE_IDS[2], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, true, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), @@ -124,7 +124,7 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(2, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1])))), arguments(aroundIncludingQuery, "Zak", 25, - new InstanceContributorBrowseResult().totalRecords(12).prev(null).next(null).items(List.of( + new ContributorBrowseResult().totalRecords(12).prev(null).next(null).items(List.of( contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(1, "Bon Jovi", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0]), @@ -141,30 +141,30 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(0, true, "Zak")))), arguments(aroundIncludingQuery, "PMC", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Paul McCartney").next(null).items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Paul McCartney").next(null).items(List.of( contributorBrowseItem(1, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(2, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(0, true, "PMC"), contributorBrowseItem(2, "Ringo Starr", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1])))), arguments(aroundIncludingQuery, "a", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev(null).next("Anthony Kiedis").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev(null).next("Anthony Kiedis").items(List.of( contributorBrowseItem(0, true, "a"), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0])))), arguments(aroundIncludingQuery, "z", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Paul McCartney").next(null).items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Paul McCartney").next(null).items(List.of( contributorBrowseItem(2, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(2, "Ringo Starr", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(0, true, "z")))), // browsing forward arguments(forwardQuery, "ringo", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Ringo Starr").next(null).items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Ringo Starr").next(null).items(List.of( contributorBrowseItem(2, "Ringo Starr", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1])))), - arguments(forwardQuery, "anthony", 5, new InstanceContributorBrowseResult() + arguments(forwardQuery, "anthony", 5, new ContributorBrowseResult() .totalRecords(12).prev("Anthony Kiedis").next("George Harrison").items(List.of( contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0]), @@ -173,13 +173,13 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(1, "Bon Jovi", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, "George Harrison", NAME_TYPE_IDS[1], AUTHORITY_IDS[0], TYPE_IDS[2])))), - arguments(forwardQuery, "Z", 10, new InstanceContributorBrowseResult().totalRecords(12).items(emptyList())), + arguments(forwardQuery, "Z", 10, new ContributorBrowseResult().totalRecords(12).items(emptyList())), arguments(forwardIncludingQuery, "Ringo Starr", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("Ringo Starr").next(null).items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("Ringo Starr").next(null).items(List.of( contributorBrowseItem(2, "Ringo Starr", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1])))), - arguments(forwardIncludingQuery, "anthony", 5, new InstanceContributorBrowseResult() + arguments(forwardIncludingQuery, "anthony", 5, new ContributorBrowseResult() .totalRecords(12).prev("Anthony Kiedis").next("George Harrison").items(List.of( contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[1], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0]), @@ -190,7 +190,7 @@ private static Stream contributorBrowsingDataProvider() { // browsing backward arguments(backwardQuery, "Ringo Starr", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( contributorBrowseItem(2, "John Lennon", NAME_TYPE_IDS[2], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(1, "Klaus Meine", NAME_TYPE_IDS[1], AUTHORITY_IDS[0]), @@ -198,17 +198,17 @@ private static Stream contributorBrowsingDataProvider() { contributorBrowseItem(2, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1])))), arguments(backwardQuery, "R", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( contributorBrowseItem(2, "John Lennon", NAME_TYPE_IDS[2], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(1, "Klaus Meine", NAME_TYPE_IDS[1], AUTHORITY_IDS[0]), contributorBrowseItem(1, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[2]), contributorBrowseItem(2, "Paul McCartney", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1])))), - arguments(backwardQuery, "A", 10, new InstanceContributorBrowseResult().totalRecords(12).items(emptyList())), + arguments(backwardQuery, "A", 10, new ContributorBrowseResult().totalRecords(12).items(emptyList())), arguments(backwardIncludingQuery, "ringo", 5, - new InstanceContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( + new ContributorBrowseResult().totalRecords(12).prev("John Lennon").next("Paul McCartney").items(List.of( contributorBrowseItem(2, "John Lennon", NAME_TYPE_IDS[2], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, "Klaus Meine", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0], TYPE_IDS[1]), contributorBrowseItem(1, "Klaus Meine", NAME_TYPE_IDS[1], AUTHORITY_IDS[0]), @@ -291,11 +291,11 @@ private static Stream facetQueriesProvider() { @DisplayName("browseByContributor_parameterized") @ParameterizedTest(name = "[{index}] query={0}, value=''{1}'', limit={2}") void browseByContributor_parameterized(String query, String anchor, Integer limit, - InstanceContributorBrowseResult expected) { + ContributorBrowseResult expected) { var request = get(instanceContributorBrowsePath()).param("query", prepareQuery(query, '"' + anchor + '"')) .param("limit", String.valueOf(limit)); - var actual = parseResponse(doGet(request), InstanceContributorBrowseResult.class); + var actual = parseResponse(doGet(request), ContributorBrowseResult.class); assertThat(actual).isEqualTo(expected); } @@ -305,8 +305,8 @@ void browseByContributor_withNameTypeFilter() { "(" + prepareQuery("name >= {value} or name < {value}", '"' + "John Lennon" + '"') + ") " + "and contributorNameTypeId==" + NAME_TYPE_IDS[0]).param("limit", "5"); - var actual = parseResponse(doGet(request), InstanceContributorBrowseResult.class); - var expected = new InstanceContributorBrowseResult().totalRecords(5).prev(null).next("Paul McCartney").items( + var actual = parseResponse(doGet(request), ContributorBrowseResult.class); + var expected = new ContributorBrowseResult().totalRecords(5).prev(null).next("Paul McCartney").items( List.of( contributorBrowseItem(1, "Anthony Kiedis", NAME_TYPE_IDS[0], AUTHORITY_IDS[1], TYPE_IDS[0]), contributorBrowseItem(2, "Bon Jovi", NAME_TYPE_IDS[0], AUTHORITY_IDS[0], TYPE_IDS[0], TYPE_IDS[1], TYPE_IDS[2]), diff --git a/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java b/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java index eb01ebd17..629bcf732 100644 --- a/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java +++ b/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java @@ -23,8 +23,8 @@ import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.List; -import org.folio.search.domain.dto.ResourceId; -import org.folio.search.domain.dto.ResourceIds; +import org.folio.search.model.ResourceId; +import org.folio.search.model.ResourceIds; import org.folio.search.model.service.CqlResourceIdsRequest; import org.folio.search.service.ResourceIdService; import org.folio.search.service.ResourceIdsJobService; diff --git a/src/test/java/org/folio/search/service/ResourceIdServiceTest.java b/src/test/java/org/folio/search/service/ResourceIdServiceTest.java index 4a3c9fb52..74738fa68 100644 --- a/src/test/java/org/folio/search/service/ResourceIdServiceTest.java +++ b/src/test/java/org/folio/search/service/ResourceIdServiceTest.java @@ -25,9 +25,9 @@ import java.util.function.Consumer; import org.folio.search.configuration.properties.StreamIdsProperties; import org.folio.search.cql.CqlSearchQueryConverter; -import org.folio.search.domain.dto.ResourceId; -import org.folio.search.domain.dto.ResourceIds; import org.folio.search.exception.SearchServiceException; +import org.folio.search.model.ResourceId; +import org.folio.search.model.ResourceIds; import org.folio.search.model.service.CqlResourceIdsRequest; import org.folio.search.model.streamids.ResourceIdsJobEntity; import org.folio.search.model.types.StreamJobStatus;