From 056d3b8469844c61092bdd2e3596221a7e94e94e Mon Sep 17 00:00:00 2001 From: Pavlo Smahin Date: Thu, 18 Apr 2024 21:29:56 +0300 Subject: [PATCH] doc: improve API documentation (descriptions, summary, examples) (#567) --- .github/workflows/spectral-lint.yml | 17 + .spectral.yaml | 157 +++++ .../search/controller/BrowseController.java | 11 +- .../search/controller/SearchController.java | 27 +- .../setter/AbstractIdentifierProcessor.java | 6 +- .../service/setter/AbstractLccnProcessor.java | 4 +- .../authority/LccnAuthorityProcessor.java | 4 +- .../ClassificationNumberProcessor.java | 6 +- .../instance/LccnInstanceProcessor.java | 4 +- .../org/folio/search/utils/SearchUtils.java | 2 +- .../request/browseConfigUpdateRequest.yaml | 6 + .../request/indexRecordRequestBody.yaml | 53 -- .../examples/request/indexRecordsRequest.yaml | 54 ++ .../examples/request/reindexRequest.yaml | 5 +- .../request/updateCreateFeatureRequest.yaml | 4 + .../request/updateIndexSettingsRequest.yaml | 5 + .../request/updateMappingsRequest.yaml | 2 + .../browseAuthorityEmptyResponse.yaml | 6 + .../browseAuthorityExpandedResponse.yaml | 34 + .../response/browseAuthorityResponse.yaml | 19 + .../browseConfigCollectionResponse.yaml | 12 + .../consortiumHoldingsCollectionResponse.yaml | 19 + .../consortiumItemCollectionResponse.yaml | 15 + .../response/indexOperationResponse.yaml | 3 + .../response/indexRecordFailureResponse.yaml | 3 + ...e.yaml => indexRecordSuccessResponse.yaml} | 0 .../examples/response/reindexJobResponse.yaml | 4 + .../examples/response/unknownError.yaml | 11 +- .../response/updateFeatureResponse.yaml | 4 + .../response/validationErrorResponse.yaml | 18 +- .../examples/result/HoldingIdsResult.yaml | 11 +- .../examples/result/IdsTextResult.yaml | 2 +- .../examples/result/InstanceIdsResult.yaml | 11 +- .../result/authoritySearchResult.yaml | 21 + .../result/browseAuthorityResult.yaml | 14 - .../result/browseCallNumberResult.yaml | 49 +- .../browseClassificationNumberResult.yaml | 24 +- .../result/browseContributorsResult.yaml | 77 +-- .../examples/result/browseSubjectResult.yaml | 33 +- .../examples/result/facetResult.yaml | 19 +- .../examples/result/instanceSearchResult.yaml | 22 + .../examples/result/resourceIdsResult.yaml | 11 +- .../examples/result/searchResult.yaml | 9 - .../resources/swagger.api/mod-search.yaml | 139 ++-- .../authority-browse-cql-query.yaml | 93 +++ .../authority-expand-all-param.yaml | 17 + .../parameters/browse-option-id.yaml | 6 +- .../swagger.api/parameters/browse-type.yaml | 4 +- .../parameters/call-number-type-param.yaml | 9 +- ...tance-classification-browse-cql-query.yaml | 49 ++ ...nstance-contributors-browse-cql-query.yaml | 55 ++ .../parameters/instance-search-cql-query.yaml | 624 ++++++++++++++++++ .../instance-subjects-browse-cql-query.yaml | 49 ++ .../parameters/preceding-records-count.yaml | 2 +- .../swagger.api/parameters/record-type.yaml | 9 +- .../parameters/sort-order-param.yaml | 5 +- .../parameters/tenant-id-query-param.yaml | 2 +- .../browse-authorities.yaml | 18 +- .../browse-call-numbers-instances.yaml | 7 +- ...l => browse-instance-classifications.yaml} | 11 +- .../browse-type-browse-option-id.yaml | 6 +- .../paths/browse-config/browse-type.yaml | 4 + .../browse-contributors-instances.yaml | 8 +- .../browse-subjects-instances.yaml | 8 +- .../search-authorities.yaml | 6 +- .../search-config-features-feature-id.yaml | 8 + .../search-config/search-config-features.yaml | 15 + .../search-config-languages-code.yaml | 12 + .../search-config-languages.yaml | 21 + .../search-consortium-holdings.yaml | 4 + .../search-consortium-items.yaml | 4 + .../search-record-type-facets.yaml | 6 +- .../search-holdings/search-holdings-ids.yaml | 12 +- .../search-index/search-index-indices.yaml | 4 + .../search-index-inventory-reindex.yaml | 9 +- .../search-index/search-index-mappings.yaml | 7 + .../search-index/search-index-records.yaml | 16 +- .../search-index/search-index-settings.yaml | 7 + .../search-instances-ids.yaml | 12 +- .../search-instances/search-instances.yaml | 8 +- .../search-resources-jobs-job-id-ids.yaml | 6 +- .../search-resources-jobs-job-id.yaml | 1 + .../search-resources-jobs.yaml | 1 + .../responses/badRequestResponse.yaml | 5 +- .../internalServerErrorResponse.yaml | 9 +- .../unprocessableEntityResponse.yaml | 3 + .../{entity => dto/authority}/authority.yaml | 28 +- .../schemas/dto/authority/authorityNote.yaml | 7 + .../common/identifier.yaml} | 1 + .../{entity => dto/common}/metadata.yaml | 1 + .../schemas/{entity => dto/common}/tags.yaml | 1 - .../instance}/alternativeTitle.yaml | 1 + .../instance}/circulationNote.yaml | 0 .../schemas/dto/instance/classification.yaml | 9 + .../{entity => dto/instance}/contributor.yaml | 1 + .../instance}/electronicAccess.yaml | 0 .../{entity => dto/instance}/holding.yaml | 5 +- .../instanceBasicSearchResultItem.yaml | 35 + .../instanceFullSearchResultItem.yaml | 129 ++++ .../{entity => dto/instance}/item.yaml | 5 +- .../{entity => dto/instance}/note.yaml | 0 .../schemas/dto/instance/publication.yaml | 8 + .../{entity => dto/instance}/seriesItem.yaml | 1 + .../{entity => dto/instance}/subject.yaml | 1 + .../schemas/entity/browseConfig.yaml | 2 - .../schemas/entity/browseOptionType.yaml | 1 + .../swagger.api/schemas/entity/error.yaml | 6 +- .../swagger.api/schemas/entity/facet.yaml | 5 +- .../schemas/entity/facetItems.yaml | 4 - .../swagger.api/schemas/entity/instance.yaml | 41 +- .../swagger.api/schemas/entity/parameter.yaml | 3 + .../schemas/entity/parameters.yaml | 5 - .../schemas/entity/recordType.yaml | 2 +- .../{resouceIds.yaml => resourceIds.yaml} | 0 .../entity/shelvingOrderAlgorithmType.yaml | 1 + .../schemas/request/indexRecordRequest.yaml | 4 - .../updateIndexDynamicSettingsRequest.yaml | 1 - .../schemas/response/authorityBrowseItem.yaml | 5 +- .../response/authoritySearchResult.yaml | 2 +- .../schemas/response/errorResponse.yaml | 9 +- .../BrowseClassificationConsortiumIT.java | 4 +- .../controller/BrowseClassificationIT.java | 4 +- .../IndexingInstanceClassificationIT.java | 6 +- .../ElasticsearchDocumentConverterTest.java | 6 +- .../AuthorityEventPreProcessorTest.java | 6 +- .../authority/LccnAuthorityProcessorTest.java | 4 +- .../ClassificationNumberProcessorTest.java | 6 +- .../InstanceAllFieldValuesProcessorTest.java | 6 +- .../setter/instance/IsbnProcessorTest.java | 6 +- .../setter/instance/IssnProcessorTest.java | 8 +- .../instance/LccnInstanceProcessorTest.java | 4 +- .../setter/instance/OclcProcessorTest.java | 6 +- .../org/folio/search/utils/TestUtils.java | 10 +- 133 files changed, 1993 insertions(+), 526 deletions(-) create mode 100644 .github/workflows/spectral-lint.yml create mode 100644 .spectral.yaml create mode 100644 src/main/resources/swagger.api/examples/request/browseConfigUpdateRequest.yaml delete mode 100644 src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml create mode 100644 src/main/resources/swagger.api/examples/request/indexRecordsRequest.yaml create mode 100644 src/main/resources/swagger.api/examples/request/updateCreateFeatureRequest.yaml create mode 100644 src/main/resources/swagger.api/examples/request/updateIndexSettingsRequest.yaml create mode 100644 src/main/resources/swagger.api/examples/request/updateMappingsRequest.yaml create mode 100644 src/main/resources/swagger.api/examples/response/browseAuthorityEmptyResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/browseAuthorityExpandedResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/browseAuthorityResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/browseConfigCollectionResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/consortiumHoldingsCollectionResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/consortiumItemCollectionResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/indexOperationResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/indexRecordFailureResponse.yaml rename src/main/resources/swagger.api/examples/response/{indexRecordResponse.yaml => indexRecordSuccessResponse.yaml} (100%) create mode 100644 src/main/resources/swagger.api/examples/response/reindexJobResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/response/updateFeatureResponse.yaml create mode 100644 src/main/resources/swagger.api/examples/result/authoritySearchResult.yaml delete mode 100644 src/main/resources/swagger.api/examples/result/browseAuthorityResult.yaml create mode 100644 src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml delete mode 100644 src/main/resources/swagger.api/examples/result/searchResult.yaml create mode 100644 src/main/resources/swagger.api/parameters/authority-browse-cql-query.yaml create mode 100644 src/main/resources/swagger.api/parameters/authority-expand-all-param.yaml create mode 100644 src/main/resources/swagger.api/parameters/instance-classification-browse-cql-query.yaml create mode 100644 src/main/resources/swagger.api/parameters/instance-contributors-browse-cql-query.yaml create mode 100644 src/main/resources/swagger.api/parameters/instance-search-cql-query.yaml create mode 100644 src/main/resources/swagger.api/parameters/instance-subjects-browse-cql-query.yaml rename src/main/resources/swagger.api/paths/browse-classification-numbers/{browse-option-id-instances.yaml => browse-instance-classifications.yaml} (69%) rename src/main/resources/swagger.api/schemas/{entity => dto/authority}/authority.yaml (93%) create mode 100644 src/main/resources/swagger.api/schemas/dto/authority/authorityNote.yaml rename src/main/resources/swagger.api/schemas/{entity/identifiers.yaml => dto/common/identifier.yaml} (91%) rename src/main/resources/swagger.api/schemas/{entity => dto/common}/metadata.yaml (96%) rename src/main/resources/swagger.api/schemas/{entity => dto/common}/tags.yaml (92%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/alternativeTitle.yaml (93%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/circulationNote.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/dto/instance/classification.yaml rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/contributor.yaml (96%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/electronicAccess.yaml (100%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/holding.yaml (94%) create mode 100644 src/main/resources/swagger.api/schemas/dto/instance/instanceBasicSearchResultItem.yaml create mode 100644 src/main/resources/swagger.api/schemas/dto/instance/instanceFullSearchResultItem.yaml rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/item.yaml (96%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/note.yaml (100%) create mode 100644 src/main/resources/swagger.api/schemas/dto/instance/publication.yaml rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/seriesItem.yaml (89%) rename src/main/resources/swagger.api/schemas/{entity => dto/instance}/subject.yaml (89%) delete mode 100644 src/main/resources/swagger.api/schemas/entity/facetItems.yaml delete mode 100644 src/main/resources/swagger.api/schemas/entity/parameters.yaml rename src/main/resources/swagger.api/schemas/entity/{resouceIds.yaml => resourceIds.yaml} (100%) delete mode 100644 src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml new file mode 100644 index 000000000..343c17908 --- /dev/null +++ b/.github/workflows/spectral-lint.yml @@ -0,0 +1,17 @@ +name: Run Spectral on Pull Requests + +on: + - pull_request + +jobs: + build: + name: Run Spectral + runs-on: ubuntu-latest + steps: + # Check out the repository + - uses: actions/checkout@v3 + + # Run Spectral + - uses: stoplightio/spectral-action@latest + with: + file_glob: 'src/main/resources/swagger.api/*.yaml' \ No newline at end of file diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 000000000..a263bff98 --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1,157 @@ +extends: [ "spectral:oas" ] +aliases: + PathItem: + description: '' + targets: + - formats: + - oas2 + given: + - "$.paths[*]" + - formats: + - oas3 + given: + - "$.paths[*]" + OperationObject: + description: 'The complete operation object. Use it in combo with field object.' + targets: + - formats: + - oas2 + given: + - "#PathItem[get,put,post,delete,options,head,patch,trace]" + - formats: + - oas3 + given: + - "#PathItem[get,put,post,delete,options,head,patch,trace]" + DescribableObjects: + description: '' + targets: + - formats: + - oas2 + given: + - "$.info" + - "$.tags[*]" + - "#OperationObject" + - "$.paths[*][*].responses[*]" + - "$..parameters[?(@ && @.in)]" + - "$.definitions[*]" + - formats: + - oas3 + given: + - "$.info" + - "$.tags[*]" + - "#OperationObject" + - "$.paths[*][*].responses[*]" + - "$..parameters[?(@ && @.in)]" + - "$.components.schemas[*]" + - "$.servers[*]" + MediaTypeObjects: + description: '' + targets: + - formats: + - oas2 + given: + - $.paths[*][*]..parameters[?(@ && @.in == "body")] + - "$.paths[*][*].responses[*]" + - formats: + - oas3 + given: + - "$.paths[*][*].requestBody.content[*]" + - "$.paths[*][*].responses[*].content[*]" +rules: + docs-descriptions: + given: + - "#DescribableObjects" + severity: warn + then: + - function: truthy + field: description + - function: length + functionOptions: + min: 10 + field: description + - function: pattern + functionOptions: + match: "/^[A-Z]/" + field: description + description: "Descriptions should be provided for describable objects, such as `info`, `tags`, `operations`, `parameters`, and more." + message: "{{error}}." + docs-info-contact: + given: + - "$" + severity: warn + then: + function: truthy + field: info.contact + description: "`Info` object should include contact information." + docs-parameters-examples-or-schema: + given: + - "$.paths.parameters[*]" + severity: info + then: + function: schema + functionOptions: + schema: + type: object + anyOf: + - required: + - examples + - required: + - schema + description: "Path parameter must contain a defined schema or examples." + message: No example or schema provided for {{property}} + formats: + - oas3 + docs-summary: + given: + - "#PathItem[*]" + severity: error + then: + - function: truthy + field: summary + description: "Path parameter must contain a defined schema or examples." + message: No summary provided for {{property}} + formats: + - oas3 + docs-media-types-examples-or-schema: + given: + - "#MediaTypeObjects" + severity: info + then: + function: schema + functionOptions: + schema: + type: object + anyOf: + - required: + - examples + - required: + - schema + description: "Media object must contain a defined schema or examples." + message: No example or schema provided for {{property}} + formats: + - oas3 + docs-tags-alphabetical: + given: + - "$" + severity: warn + then: + function: alphabetical + functionOptions: + keyedBy: name + field: tags + description: "Tags are not in alphabetical order." + message: Tags should be defined in alphabetical order + docs-operation-tags: + given: + - "#OperationObject" + severity: warn + then: + function: schema + functionOptions: + schema: + type: array + minItems: 1 + field: tags + description: "Operation must have at least one tag." + message: Operation should have non-empty `tags` array. + diff --git a/src/main/java/org/folio/search/controller/BrowseController.java b/src/main/java/org/folio/search/controller/BrowseController.java index 44796ccd5..8dbe5184c 100644 --- a/src/main/java/org/folio/search/controller/BrowseController.java +++ b/src/main/java/org/folio/search/controller/BrowseController.java @@ -53,10 +53,9 @@ public class BrowseController implements BrowseApi { private final TenantProvider tenantProvider; @Override - public ResponseEntity browseAuthorities(String query, String tenant, - Integer limit, Boolean expandAll, - Boolean highlightMatch, - Integer precedingRecordsCount) { + public ResponseEntity browseAuthorities(String query, String tenant, Boolean expandAll, + Boolean highlightMatch, Integer precedingRecordsCount, + Integer limit) { var browseRequest = getBrowseRequestBuilder(query, tenant, limit, expandAll, highlightMatch, precedingRecordsCount) .resource(AUTHORITY_RESOURCE).targetField(AUTHORITY_BROWSING_FIELD).build(); var browseResult = authorityBrowseService.browse(browseRequest); @@ -90,10 +89,10 @@ public ResponseEntity browseInstancesByCallNumber(String @Override public ResponseEntity browseInstancesByClassificationNumber( - BrowseOptionType browseOptionId, String query, String tenant, Integer limit, Boolean expandAll, + BrowseOptionType browseOptionId, String query, String tenant, Integer limit, Boolean highlightMatch, Integer precedingRecordsCount) { - var browseRequest = getBrowseRequestBuilder(query, tenant, limit, expandAll, highlightMatch, precedingRecordsCount) + var browseRequest = getBrowseRequestBuilder(query, tenant, limit, false, highlightMatch, precedingRecordsCount) .resource(INSTANCE_CLASSIFICATION_RESOURCE) .browseOptionType(browseOptionId) .targetField(CLASSIFICATION_NUMBER_BROWSING_FIELD) diff --git a/src/main/java/org/folio/search/controller/SearchController.java b/src/main/java/org/folio/search/controller/SearchController.java index fbdb2a336..0d5d3ec3e 100644 --- a/src/main/java/org/folio/search/controller/SearchController.java +++ b/src/main/java/org/folio/search/controller/SearchController.java @@ -24,19 +24,9 @@ public class SearchController implements SearchApi { private final TenantProvider tenantProvider; @Override - public ResponseEntity searchInstances(String tenantId, String query, Integer limit, - Integer offset, Boolean expandAll) { - tenantId = tenantProvider.getTenant(tenantId); - var searchRequest = CqlSearchRequest.of(Instance.class, tenantId, query, limit, offset, expandAll); - var result = searchService.search(searchRequest); - return ResponseEntity.ok(new InstanceSearchResult() - .instances(result.getRecords()) - .totalRecords(result.getTotalRecords())); - } - - @Override - public ResponseEntity searchAuthorities( - String tenant, String query, Integer limit, Integer offset, Boolean expandAll, Boolean includeNumberOfTitles) { + public ResponseEntity searchAuthorities(String tenant, String query, Integer limit, + Integer offset, Boolean expandAll, + Boolean includeNumberOfTitles) { tenant = tenantProvider.getTenant(tenant); var searchRequest = CqlSearchRequest.of( @@ -46,4 +36,15 @@ public ResponseEntity searchAuthorities( .authorities(result.getRecords()) .totalRecords(result.getTotalRecords())); } + + @Override + public ResponseEntity searchInstances(String tenantId, String query, Integer limit, + Integer offset, Boolean expandAll) { + tenantId = tenantProvider.getTenant(tenantId); + var searchRequest = CqlSearchRequest.of(Instance.class, tenantId, query, limit, offset, expandAll); + var result = searchService.search(searchRequest); + return ResponseEntity.ok(new InstanceSearchResult() + .instances(result.getRecords()) + .totalRecords(result.getTotalRecords())); + } } diff --git a/src/main/java/org/folio/search/service/setter/AbstractIdentifierProcessor.java b/src/main/java/org/folio/search/service/setter/AbstractIdentifierProcessor.java index f644a3a07..7d44c296d 100644 --- a/src/main/java/org/folio/search/service/setter/AbstractIdentifierProcessor.java +++ b/src/main/java/org/folio/search/service/setter/AbstractIdentifierProcessor.java @@ -11,7 +11,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; @@ -29,12 +29,12 @@ public abstract class AbstractIdentifierProcessor implements FieldProcessor filterIdentifiersValue(List identifiers) { + protected Set filterIdentifiersValue(List identifiers) { var identifierTypeIds = fetchIdentifierIdsFromCache(); return toStreamSafe(identifiers) .filter(identifier -> identifierTypeIds.contains(identifier.getIdentifierTypeId())) - .map(Identifiers::getValue) + .map(Identifier::getValue) .filter(Objects::nonNull) .map(String::trim) .collect(toCollection(LinkedHashSet::new)); diff --git a/src/main/java/org/folio/search/service/setter/AbstractLccnProcessor.java b/src/main/java/org/folio/search/service/setter/AbstractLccnProcessor.java index e3e51ca8d..6cd098a02 100644 --- a/src/main/java/org/folio/search/service/setter/AbstractLccnProcessor.java +++ b/src/main/java/org/folio/search/service/setter/AbstractLccnProcessor.java @@ -9,7 +9,7 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.integration.ReferenceDataService; public abstract class AbstractLccnProcessor extends AbstractIdentifierProcessor { @@ -28,5 +28,5 @@ public Set getFieldValue(T entity) { .collect(Collectors.toCollection(LinkedHashSet::new)); } - protected abstract List getIdentifiers(T entity); + protected abstract List getIdentifiers(T entity); } diff --git a/src/main/java/org/folio/search/service/setter/authority/LccnAuthorityProcessor.java b/src/main/java/org/folio/search/service/setter/authority/LccnAuthorityProcessor.java index 71cd859b8..8f2e56cf4 100644 --- a/src/main/java/org/folio/search/service/setter/authority/LccnAuthorityProcessor.java +++ b/src/main/java/org/folio/search/service/setter/authority/LccnAuthorityProcessor.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Optional; import org.folio.search.domain.dto.Authority; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.integration.ReferenceDataService; import org.folio.search.service.setter.AbstractLccnProcessor; import org.springframework.stereotype.Component; @@ -22,7 +22,7 @@ public LccnAuthorityProcessor(ReferenceDataService referenceDataService) { } @Override - protected List getIdentifiers(Authority authority) { + protected List getIdentifiers(Authority authority) { return Optional.ofNullable(authority) .map(Authority::getIdentifiers) .orElse(Collections.emptyList()); diff --git a/src/main/java/org/folio/search/service/setter/instance/ClassificationNumberProcessor.java b/src/main/java/org/folio/search/service/setter/instance/ClassificationNumberProcessor.java index cb33e805b..1c08ef094 100644 --- a/src/main/java/org/folio/search/service/setter/instance/ClassificationNumberProcessor.java +++ b/src/main/java/org/folio/search/service/setter/instance/ClassificationNumberProcessor.java @@ -6,8 +6,8 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; +import org.folio.search.domain.dto.Classification; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceClassificationsInner; import org.folio.search.service.setter.FieldProcessor; import org.folio.search.utils.SearchUtils; import org.springframework.stereotype.Component; @@ -17,9 +17,9 @@ public class ClassificationNumberProcessor implements FieldProcessor getFieldValue(Instance instance) { - List classifications = instance.getClassifications(); + List classifications = instance.getClassifications(); return toStreamSafe(classifications) - .map(InstanceClassificationsInner::getClassificationNumber) + .map(Classification::getClassificationNumber) .map(SearchUtils::normalizeToAlphaNumeric) .filter(Objects::nonNull) .collect(Collectors.toSet()); diff --git a/src/main/java/org/folio/search/service/setter/instance/LccnInstanceProcessor.java b/src/main/java/org/folio/search/service/setter/instance/LccnInstanceProcessor.java index 7096b99ef..6c24483df 100644 --- a/src/main/java/org/folio/search/service/setter/instance/LccnInstanceProcessor.java +++ b/src/main/java/org/folio/search/service/setter/instance/LccnInstanceProcessor.java @@ -3,7 +3,7 @@ import java.util.Collections; import java.util.List; import java.util.Optional; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.service.setter.AbstractLccnProcessor; @@ -25,7 +25,7 @@ public LccnInstanceProcessor(ReferenceDataService referenceDataService) { } @Override - protected List getIdentifiers(Instance instance) { + protected List getIdentifiers(Instance instance) { return Optional.ofNullable(instance) .map(Instance::getIdentifiers) .orElse(Collections.emptyList()); diff --git a/src/main/java/org/folio/search/utils/SearchUtils.java b/src/main/java/org/folio/search/utils/SearchUtils.java index 6b14931b8..646a20886 100644 --- a/src/main/java/org/folio/search/utils/SearchUtils.java +++ b/src/main/java/org/folio/search/utils/SearchUtils.java @@ -152,7 +152,7 @@ public static String getIndexName(ResourceEvent event) { * @return generated index name. */ public static String getIndexName(String resource, String tenantId) { - return getFolioEnvName().toLowerCase(ROOT) + "_" + resource + "_" + tenantId; + return getFolioEnvName().toLowerCase(ROOT) + "_" + resource.toLowerCase(ROOT) + "_" + tenantId; } /** diff --git a/src/main/resources/swagger.api/examples/request/browseConfigUpdateRequest.yaml b/src/main/resources/swagger.api/examples/request/browseConfigUpdateRequest.yaml new file mode 100644 index 000000000..43ee3ab9b --- /dev/null +++ b/src/main/resources/swagger.api/examples/request/browseConfigUpdateRequest.yaml @@ -0,0 +1,6 @@ +value: + id: all + shelvingAlgorithm: default + typeIds: + - 7e5684a9-c8c1-4c1e-85b9-d047f53eeb6d + - 1faf5a71-01cc-4f14-82e8-38e26b6e3071 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml b/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml deleted file mode 100644 index a96bd62fb..000000000 --- a/src/main/resources/swagger.api/examples/request/indexRecordRequestBody.yaml +++ /dev/null @@ -1,53 +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/request/indexRecordsRequest.yaml b/src/main/resources/swagger.api/examples/request/indexRecordsRequest.yaml new file mode 100644 index 000000000..54a9a5d97 --- /dev/null +++ b/src/main/resources/swagger.api/examples/request/indexRecordsRequest.yaml @@ -0,0 +1,54 @@ +value: + - 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/request/reindexRequest.yaml b/src/main/resources/swagger.api/examples/request/reindexRequest.yaml index 48d64e46b..45cea543a 100644 --- a/src/main/resources/swagger.api/examples/request/reindexRequest.yaml +++ b/src/main/resources/swagger.api/examples/request/reindexRequest.yaml @@ -1,2 +1,3 @@ -recreateIndex: true - +value: + recreateIndex: true + resourceName: instance \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/request/updateCreateFeatureRequest.yaml b/src/main/resources/swagger.api/examples/request/updateCreateFeatureRequest.yaml new file mode 100644 index 000000000..748825acd --- /dev/null +++ b/src/main/resources/swagger.api/examples/request/updateCreateFeatureRequest.yaml @@ -0,0 +1,4 @@ +value: + feature: "search.all.fields" + enabled: false +summary: Disable Search all fields feature. \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/request/updateIndexSettingsRequest.yaml b/src/main/resources/swagger.api/examples/request/updateIndexSettingsRequest.yaml new file mode 100644 index 000000000..12528fa71 --- /dev/null +++ b/src/main/resources/swagger.api/examples/request/updateIndexSettingsRequest.yaml @@ -0,0 +1,5 @@ +value: + resourceName: instance + indexSettings: + numberOfReplicas: 4 + refreshInterval: -1 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/request/updateMappingsRequest.yaml b/src/main/resources/swagger.api/examples/request/updateMappingsRequest.yaml new file mode 100644 index 000000000..65f9a13c5 --- /dev/null +++ b/src/main/resources/swagger.api/examples/request/updateMappingsRequest.yaml @@ -0,0 +1,2 @@ +value: + resourceName: authority \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/browseAuthorityEmptyResponse.yaml b/src/main/resources/swagger.api/examples/response/browseAuthorityEmptyResponse.yaml new file mode 100644 index 000000000..e5f16ea64 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/browseAuthorityEmptyResponse.yaml @@ -0,0 +1,6 @@ +value: + totalRecords: 0 + items: + - headingRef: 'Allen, Barbara' + isAnchor: true +summary: Empty browse response diff --git a/src/main/resources/swagger.api/examples/response/browseAuthorityExpandedResponse.yaml b/src/main/resources/swagger.api/examples/response/browseAuthorityExpandedResponse.yaml new file mode 100644 index 000000000..a34aac87c --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/browseAuthorityExpandedResponse.yaml @@ -0,0 +1,34 @@ +value: + totalRecords: 3 + prev: 'Adair, Thomas Montgomery, 1913-1988' + next: 'Leven, Mel' + items: + - headingRef: 'Allen, Barbara' + isAnchor: true + - authority: + id: c277c198-dee9-418e-a1ea-05d64a586c48 + tenantId: fs09000000 + shared: false + personalName: 'Allen, Bruce Ware' + subjectHeadings: a + identifiers: + - value: n 2015023577 + identifierTypeId: 5d164f4b-0b15-4e42-ae75-cfcf85318ad9 + - value: n 2015023577 + identifierTypeId: ddaf3d51-de81-4768-b1aa-a1e985d4e999 + - value: (DLC)n 2015023577 + identifierTypeId: 2baf4cec-6abf-438b-abd0-a6c512c3c173 + notes: [ ] + metadata: + createdDate: '2024-04-01T01:37:34.15755006Z' + createdByUserId: 7816fe0c-3389-4df5-85fb-d38c5c7bd9ed + updatedDate: '2024-04-01T01:37:34.15755006Z' + updatedByUserId: 7816fe0c-3389-4df5-85fb-d38c5c7bd9ed + headingType: Personal Name + authRefType: Authorized + headingRef: 'Allen, Bruce Ware' + numberOfTitles: 0 + sourceFileId: af045f2f-e851-4613-984c-4bc13430454a + naturalId: n2015023577 + headingRef: 'Allen, Bruce Ware' +summary: Browse expanded response diff --git a/src/main/resources/swagger.api/examples/response/browseAuthorityResponse.yaml b/src/main/resources/swagger.api/examples/response/browseAuthorityResponse.yaml new file mode 100644 index 000000000..750fbd8e2 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/browseAuthorityResponse.yaml @@ -0,0 +1,19 @@ +value: + totalRecords: 3 + prev: 'Adair, Thomas Montgomery, 1913-1988' + next: 'Leven, Mel' + items: + - headingRef: 'Allen, Barbara' + isAnchor: true + - authority: + id: 7c1fff0d-6c83-4ee9-b64b-2beb0d3b9bfd + tenantId: diku + shared: false + headingType: Personal Name + authRefType: Reference + headingRef: 'Allen, Barbara, 1906-1974' + sourceFileId: af045f2f-e851-4613-984c-4bc13430454a + naturalId: n94088693 + numberOfTitles: 2 + headingRef: 'Allen, Barbara, 1906-1974' +summary: Browse response diff --git a/src/main/resources/swagger.api/examples/response/browseConfigCollectionResponse.yaml b/src/main/resources/swagger.api/examples/response/browseConfigCollectionResponse.yaml new file mode 100644 index 000000000..e3c09a02c --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/browseConfigCollectionResponse.yaml @@ -0,0 +1,12 @@ +value: + configs: + - id: all + shelvingAlgorithm: default + typeIds: [ ] + - id: dewey + shelvingAlgorithm: dewey + typeIds: [ ] + - id: lc + shelvingAlgorithm: lc + typeIds: [ ] + totalRecords: 3 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/consortiumHoldingsCollectionResponse.yaml b/src/main/resources/swagger.api/examples/response/consortiumHoldingsCollectionResponse.yaml new file mode 100644 index 000000000..5376e4278 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/consortiumHoldingsCollectionResponse.yaml @@ -0,0 +1,19 @@ +value: + holdings: + - id: 68ec4438-8b93-46df-8c36-232db4f7862e + hrid: ho00231 + tenantId: college + instanceId: 1af42087-458d-4777-a797-a7717020ab18 + discoverySuppress: false + callNumberPrefix: int + callNumber: MS 33.123 + callNumberSuffix: pro + copyNumber: c10 + permanentLocationId: e18610eb-0842-4dac-bd6a-23e6ef962230 + - id: b6993450-25c1-4c23-a1d1-98abb67fb506 + hrid: ho00333 + tenantId: university + instanceId: 1af42087-458d-4777-a797-a7717020ab18 + discoverySuppress: true + permanentLocationId: e18610eb-0842-4dac-bd6a-23e6ef962230 + totalRecords: 1203 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/consortiumItemCollectionResponse.yaml b/src/main/resources/swagger.api/examples/response/consortiumItemCollectionResponse.yaml new file mode 100644 index 000000000..325a50e46 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/consortiumItemCollectionResponse.yaml @@ -0,0 +1,15 @@ +value: + items: + - id: 68ec4438-8b93-46df-8c36-232db4f7862e + hrid: it00231 + tenantId: college + instanceId: 1af42087-458d-4777-a797-a7717020ab18 + holdingsRecordId: 2ec87381-cfc6-4cd7-8368-9398410a64c4 + barcode: "1233322" + - id: dab66210-5038-424a-a31e-cda18b4d4061 + hrid: it00033321 + tenantId: university + instanceId: 1af42087-458d-4777-a797-a7717020ab18 + holdingsRecordId: 2ec87381-cfc6-4cd7-8368-9398410a64c4 + barcode: "7873426" + totalRecords: 1203 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/indexOperationResponse.yaml b/src/main/resources/swagger.api/examples/response/indexOperationResponse.yaml new file mode 100644 index 000000000..019e0c442 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/indexOperationResponse.yaml @@ -0,0 +1,3 @@ +value: + errorMessage: Failed to update index settings + status: error diff --git a/src/main/resources/swagger.api/examples/response/indexRecordFailureResponse.yaml b/src/main/resources/swagger.api/examples/response/indexRecordFailureResponse.yaml new file mode 100644 index 000000000..5d76feb7b --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/indexRecordFailureResponse.yaml @@ -0,0 +1,3 @@ +value: + status: error + errorMessage: Instance index doesn't exist diff --git a/src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml b/src/main/resources/swagger.api/examples/response/indexRecordSuccessResponse.yaml similarity index 100% rename from src/main/resources/swagger.api/examples/response/indexRecordResponse.yaml rename to src/main/resources/swagger.api/examples/response/indexRecordSuccessResponse.yaml diff --git a/src/main/resources/swagger.api/examples/response/reindexJobResponse.yaml b/src/main/resources/swagger.api/examples/response/reindexJobResponse.yaml new file mode 100644 index 000000000..95e4566e2 --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/reindexJobResponse.yaml @@ -0,0 +1,4 @@ +value: + id: 68ec4438-8b93-46df-8c36-232db4f7862e + jobStatus: In progress + submittedDate: "2024-12-05T10:22:22" \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/unknownError.yaml b/src/main/resources/swagger.api/examples/response/unknownError.yaml index 011608bea..774f5f86a 100644 --- a/src/main/resources/swagger.api/examples/response/unknownError.yaml +++ b/src/main/resources/swagger.api/examples/response/unknownError.yaml @@ -1,5 +1,6 @@ -errors: - - message: "Illegal argument error" - type: "IllegalArgumentException" - code: "unknown_error" -total_records: 1 +value: + errors: + - message: "Illegal argument error" + type: "IllegalArgumentException" + code: "unknown_error" + total_records: 1 diff --git a/src/main/resources/swagger.api/examples/response/updateFeatureResponse.yaml b/src/main/resources/swagger.api/examples/response/updateFeatureResponse.yaml new file mode 100644 index 000000000..748825acd --- /dev/null +++ b/src/main/resources/swagger.api/examples/response/updateFeatureResponse.yaml @@ -0,0 +1,4 @@ +value: + feature: "search.all.fields" + enabled: false +summary: Disable Search all fields feature. \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml b/src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml index 029ba1111..33328e05c 100644 --- a/src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml +++ b/src/main/resources/swagger.api/examples/response/validationErrorResponse.yaml @@ -1,8 +1,10 @@ -total_records: 1 -errors: - - message: "must not be null" - type: "MethodArgumentNotValidException" - code: "validation_error" - parameters: - - key: "parameter" - value: "null" +value: + 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/examples/result/HoldingIdsResult.yaml b/src/main/resources/swagger.api/examples/result/HoldingIdsResult.yaml index 77be53498..6495f00e3 100644 --- a/src/main/resources/swagger.api/examples/result/HoldingIdsResult.yaml +++ b/src/main/resources/swagger.api/examples/result/HoldingIdsResult.yaml @@ -1,5 +1,6 @@ -ids: - - id: "dfb3afad-15c8-4243-9df1-81b12ebd6413" - - id: "c95c7b5d-1fc2-4615-9c73-7034113d30fd" - - id: "2d8abe4b-be87-441c-a163-c3876aa9717b" -totalRecords: 3 +value: + 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/result/IdsTextResult.yaml b/src/main/resources/swagger.api/examples/result/IdsTextResult.yaml index f8ba5b956..9ef6ae333 100644 --- a/src/main/resources/swagger.api/examples/result/IdsTextResult.yaml +++ b/src/main/resources/swagger.api/examples/result/IdsTextResult.yaml @@ -1,4 +1,4 @@ -text: | +value: | 5fab345a-30a4-4aee-8667-1e33d4627ce9 e60063f6-db50-4a2a-93f6-6b27ab0420f2 e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9 diff --git a/src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml b/src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml index 1c517385f..1e3d06228 100644 --- a/src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml +++ b/src/main/resources/swagger.api/examples/result/InstanceIdsResult.yaml @@ -1,5 +1,6 @@ -ids: - - id: "e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9" - - id: "e60063f6-db50-4a2a-93f6-6b27ab0420f2" - - id: "5fab345a-30a4-4aee-8667-1e33d4627ce9" -totalRecords: 3 +value: + 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/result/authoritySearchResult.yaml b/src/main/resources/swagger.api/examples/result/authoritySearchResult.yaml new file mode 100644 index 000000000..a08b011b7 --- /dev/null +++ b/src/main/resources/swagger.api/examples/result/authoritySearchResult.yaml @@ -0,0 +1,21 @@ +value: + totalRecords: 10 + authorities: + - id: f866ae27-ec31-4eb4-8ade-89fe3d9625eb + tenantId: diku + shared: false + headingType: Personal Name + authRefType: Authorized + headingRef: Kerouac, Jack + numberOfTitles: 0 + sourceFileId: 'NULL' + naturalId: aat32 + - id: d16bc790-fa2a-4bae-9563-9796bc7bef3c + tenantId: diku + shared: false + headingType: Personal Name + authRefType: Authorized + headingRef: Roberts, Julia, 1967- + numberOfTitles: 1 + sourceFileId: af045f2f-e851-4613-984c-4bc13430454a + naturalId: n910740801 diff --git a/src/main/resources/swagger.api/examples/result/browseAuthorityResult.yaml b/src/main/resources/swagger.api/examples/result/browseAuthorityResult.yaml deleted file mode 100644 index a0cebcad1..000000000 --- a/src/main/resources/swagger.api/examples/result/browseAuthorityResult.yaml +++ /dev/null @@ -1,14 +0,0 @@ -totalRecords: 1 -prev: "string" -next: "string" -items: - - authority: - 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/result/browseCallNumberResult.yaml b/src/main/resources/swagger.api/examples/result/browseCallNumberResult.yaml index df7d9146c..18869de02 100644 --- a/src/main/resources/swagger.api/examples/result/browseCallNumberResult.yaml +++ b/src/main/resources/swagger.api/examples/result/browseCallNumberResult.yaml @@ -1,16 +1,33 @@ -totalRecords: 1 -prev: "string" -next: "string" -items: - - fullCallNumber: "Bilingualism: a bibliography of 1000 references with special reference to Wales." - shelfKey: "Bilingualism: a bibliography of 1000 references with special reference to Wales." - isAnchor: true - totalRecords: 1 - instance: - 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" +value: + items: + - fullCallNumber: "Bilingualism: a bibliography of 1000 references with special reference to Wales." + shelfKey: "Bilingualism: a bibliography of 1000 references with special reference to Wales." + isAnchor: true + totalRecords: 1 + instance: + 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" + electronicAccess: + - uri: "http://www.example.com" + notes: + - note: "Staff note" + items: + - barcode: "12345" + notes: + - note: "Staff note" + electronicAccess: + - uri: "http://www.example.com" + holdings: + - callNumber: "FS 124.44" + notes: + - note: "Staff note" + electronicAccess: + - uri: "http://www.example.com" + prev: "string" + next: "string" + totalRecords: 1 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/result/browseClassificationNumberResult.yaml b/src/main/resources/swagger.api/examples/result/browseClassificationNumberResult.yaml index 0cebc3a62..19adbda18 100644 --- a/src/main/resources/swagger.api/examples/result/browseClassificationNumberResult.yaml +++ b/src/main/resources/swagger.api/examples/result/browseClassificationNumberResult.yaml @@ -1,12 +1,12 @@ -totalRecords: 2 -prev: "string" -next: "string" -items: - - classificationNumber: "QA76.73.C15" - classificationTypeId: "LC" - isAnchor: true - totalRecords: 10 - - classificationNumber: "TK5105.88815" - classificationTypeId: "DDC" - isAnchor: false - totalRecords: 5 +value: + totalRecords: 2 + prev: "QA76.73.C15" + items: + - classificationNumber: "QA76.73.C15" + classificationTypeId: "5af5cb9d-063f-48ea-8148-7da3ecaafd7d" + isAnchor: true + totalRecords: 10 + - classificationNumber: "TK5105.88815" + classificationTypeId: "7e5684a9-c8c1-4c1e-85b9-d047f53eeb6d" + isAnchor: false + totalRecords: 5 diff --git a/src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml b/src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml index 7bd0c930c..e7ef64809 100644 --- a/src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml +++ b/src/main/resources/swagger.api/examples/result/browseContributorsResult.yaml @@ -1,38 +1,39 @@ -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 +value: + 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/result/browseSubjectResult.yaml b/src/main/resources/swagger.api/examples/result/browseSubjectResult.yaml index 61cc06880..9876283a6 100644 --- a/src/main/resources/swagger.api/examples/result/browseSubjectResult.yaml +++ b/src/main/resources/swagger.api/examples/result/browseSubjectResult.yaml @@ -1,16 +1,17 @@ -totalRecords: 3 -prev: "string" -next: "string" -items: - - value: "Biology" - isAnchor: true - totalRecords: 5 - authorityId: "d20569a7-9bba-44dd-9ad5-6f8f1d24ee1f" - - value: "Chemistry" - isAnchor: false - totalRecords: 5 - authorityId: "11110000-fcf6-45cc-b6da-4420a61ef72c" - - value: "Physics" - isAnchor: false - totalRecords: 5 - authorityId: "5fab345a-30a4-4aee-8667-1e33d4627ce9" +value: + totalRecords: 10 + prev: "Biology" + next: "Physics" + items: + - value: "Biology" + isAnchor: true + totalRecords: 5 + authorityId: "d20569a7-9bba-44dd-9ad5-6f8f1d24ee1f" + - value: "Chemistry" + isAnchor: false + totalRecords: 5 + authorityId: "11110000-fcf6-45cc-b6da-4420a61ef72c" + - value: "Physics" + isAnchor: false + totalRecords: 5 + authorityId: "5fab345a-30a4-4aee-8667-1e33d4627ce9" diff --git a/src/main/resources/swagger.api/examples/result/facetResult.yaml b/src/main/resources/swagger.api/examples/result/facetResult.yaml index ae1a0f7bb..3f5755336 100644 --- a/src/main/resources/swagger.api/examples/result/facetResult.yaml +++ b/src/main/resources/swagger.api/examples/result/facetResult.yaml @@ -1,9 +1,10 @@ -facets: - source: - values: - - id: "MARC" - totalRecords: 20 - - id: "FOLIO" - totalRecords: 10 - totalRecords: 2 -totalRecords: 1 +value: + facets: + source: + values: + - id: "MARC" + totalRecords: 20 + - id: "FOLIO" + totalRecords: 10 + totalRecords: 2 + totalRecords: 1 diff --git a/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml b/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml new file mode 100644 index 000000000..c93220fc6 --- /dev/null +++ b/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml @@ -0,0 +1,22 @@ +value: + instances: + - id: "d20569a7-9bba-44dd-9ad5-6f8f1d24ee1f" + tenantId: "tenant" + shared: false + title: "Bilingualism: a bibliography of 1000 references with special reference to Wales." + contributors: + - name: "Eichhorst, Georg." + contributorTypeId: "a" + authorityId: "a" + primary: true + publication: + - publisher: "Duncker und Humblot" + dateOfPublication: "1976" + staffSuppress: false + discoverySuppress: false + isBoundWith: false + electronicAccess: [ ] + notes: [ ] + items: [ ] + holdings: [ ] + totalRecords: 1 \ No newline at end of file diff --git a/src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml b/src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml index 548c28abb..77b941aaa 100644 --- a/src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml +++ b/src/main/resources/swagger.api/examples/result/resourceIdsResult.yaml @@ -1,5 +1,6 @@ -ids: - - id: e7e7f4a4-ff8e-48f4-ae8e-25770b7ab4b9 - - id: e60063f6-db50-4a2a-93f6-6b27ab0420f2 - - id: 5fab345a-30a4-4aee-8667-1e33d4627ce9 -totalRecords: 3 +value: + 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/result/searchResult.yaml b/src/main/resources/swagger.api/examples/result/searchResult.yaml deleted file mode 100644 index 21ecaa0f6..000000000 --- a/src/main/resources/swagger.api/examples/result/searchResult.yaml +++ /dev/null @@ -1,9 +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/mod-search.yaml b/src/main/resources/swagger.api/mod-search.yaml index 55d84c7ec..5917f5976 100644 --- a/src/main/resources/swagger.api/mod-search.yaml +++ b/src/main/resources/swagger.api/mod-search.yaml @@ -2,10 +2,45 @@ openapi: 3.0.0 info: title: Search API version: v2.1.0 - description: Search API + description: | + API for searching, browsing, and managing facets for various record types, including instances, holdings, and authorities. + It also provides endpoints for configuring search and browse features, as well as managing the search index. + contact: + name: Spitfire team servers: - - url: https://folio-dev-spitfire-okapi.ci.folio.org/ + - url: https://{environment}-okapi.ci.folio.org + description: Development environments. + variables: + environment: + default: folio-dev-spitfire + enum: + - folio-dev-spitfire + - folio-perf-spitfire + - url: https://folio-{environment}-okapi.dev.folio.org + description: Reference environments. + variables: + environment: + default: snapshot + enum: + - snapshot + - snapshot-2 + +tags: + - name: browse + description: Provides endpoints to browse records (e.g., instances, authorities) in alphabetical order by a specific field, such as call number, classification number, subject, or contributor. + - name: config + description: Provides endpoints to configure search and browse features, such as enabling/disabling specific features or managing language settings. + - name: facets + description: Provides endpoints to retrieve aggregated information (facets) about records, such as counts of records by specific fields or ranges of values. This can be used for faceted search or browsing. + - name: index-management + description: Provides endpoints to manage the search index, including creating or updating mappings, settings, and manually populating the index with records from external sources (e.g., inventory). + - name: search + description: Provides endpoints to search for records (e.g., instances, authorities) using CQL (Contextual Query Language) queries. Supports various search options and retrieval of search results. + - name: search-consortium + description: Provides endpoints to search for consolidated records (e.g., holdings, items) across multiple institutions or libraries within a consortium. + - name: search-resources-ids + description: Provides endpoints to retrieve record IDs by CQL queries, without returning the full record data. paths: /search/instances: @@ -69,7 +104,7 @@ paths: $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' + $ref: 'paths/browse-classification-numbers/browse-instance-classifications.yaml' /browse/subjects/instances: $ref: 'paths/browse-subject/browse-subjects-instances.yaml' @@ -86,100 +121,6 @@ paths: /browse/config/{browseType}/{browseOptionId}: $ref: 'paths/browse-config/browse-type-browse-option-id.yaml' -components: - schemas: - callNumberType: - $ref: 'schemas/entity/callNumberType.yaml' - sortOrder: - $ref: 'schemas/entity/sortOrder.yaml' - browseType: - $ref: 'schemas/entity/browseType.yaml' - recordType: - $ref: 'schemas/entity/recordType.yaml' - browseOptionType: - $ref: 'schemas/entity/browseOptionType.yaml' - - responses: - unprocessableEntityResponse: - $ref: 'responses/unprocessableEntityResponse.yaml' - badRequestResponse: - $ref: 'responses/badRequestResponse.yaml' - internalServerErrorResponse: - $ref: 'responses/internalServerErrorResponse.yaml' - - parameters: - limit-param: - $ref: 'parameters/limit-param.yaml' - consortium-limit-param: - $ref: 'parameters/consortium-limit-param.yaml' - browse-limit-param: - $ref: 'parameters/browse-limit-param.yaml' - offset-param: - $ref: 'parameters/offset-param.yaml' - cql-query: - $ref: 'parameters/cql-query.yaml' - expand-all-param: - $ref: 'parameters/expand-all-param.yaml' - facet-param: - $ref: 'parameters/facet-param.yaml' - language-code: - $ref: 'parameters/language-code.yaml' - feature-id: - $ref: 'parameters/feature-id.yaml' - x-okapi-tenant-header: - $ref: 'parameters/x-okapi-tenant-header.yaml' - content-type-header: - $ref: 'parameters/content-type-header.yaml' - preceding-records-count: - $ref: 'parameters/preceding-records-count.yaml' - highlight-match: - $ref: 'parameters/highlight-match.yaml' - job-stream-id: - $ref: 'parameters/job-stream-id.yaml' - instance-id-query-param: - $ref: 'parameters/instance-id-query-param.yaml' - holdings-id-query-param: - $ref: 'parameters/holdings-id-query-param.yaml' - tenant-id-query-param: - $ref: 'parameters/tenant-id-query-param.yaml' - sort-by-holdings-param: - $ref: 'parameters/sort-by-holdings-param.yaml' - sort-by-item-param: - $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' - include-number-of-titles: - $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' - browse-type: - name: browseType - in: path - required: true - description: 'Browse feature type' - schema: - $ref: '#/components/schemas/browseType' - record-type: - name: recordType - required: true - in: path - schema: - $ref: '#/components/schemas/recordType' - call-number-type-param: - in: query - name: callNumberType - description: Type of call number - required: false - schema: - $ref: '#/components/schemas/callNumberType' + + diff --git a/src/main/resources/swagger.api/parameters/authority-browse-cql-query.yaml b/src/main/resources/swagger.api/parameters/authority-browse-cql-query.yaml new file mode 100644 index 000000000..0b574f25a --- /dev/null +++ b/src/main/resources/swagger.api/parameters/authority-browse-cql-query.yaml @@ -0,0 +1,93 @@ +name: query +in: query +required: true +description: | + A CQL query string with filter conditions must include anchor query with range conditions. Anchor field is `headingRef`. + Filters support logic operators `AND` and `OR`. All filters should be combined in parentheses. + Anchor will be included only if `<=` or `>=` are used in the query. Otherwise, the empty row will be added if `highlightMatch` is equal to `true`. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Supported filter options +
OptionData typeSupported operatorsDescription
tenantIdstring==Filter by tenant ID in consortium
sharedboolean==Filter by shared/non-shared in consortium
sourceFileIduuid==Filter by authority source file ID. `NULL` value to filter by non-specified.
headingTypestring==Filter by heading type: `Personal Name`, `Corporate Name`, `Conference Name`, `Geographic Name`, `Uniform + Title`, `Topical`, `Genre` +
isTitleHeadingRefboolean==Filter title/non-title heading
authRefTypeboolean==Filter by reference type: `Authorized`, `Reference`, `Auth/Ref`
subjectHeadingschar==Filter by subject heading code
metadata.createdDatedate==, >, <, <=, >=Filter by authority create date
metadata.updatedDatedate==, >, <, <=, >=Filter by authority update date
+schema: + type: string +examples: + browseAround: + value: headingRef >= "Comic-Con" or headingRef < "Comic-Con" + summary: Search for all authority headings before and after "Comic-Con" + browseForward: + value: headingRef >= "Comic-Con" + summary: Search for all authority headings after "Comic-Con" + browseBackward: + value: headingRef >= "Comic-Con" + summary: Search for all authority headings before "Comic-Con" + browseAroundWithFilters: + value: (headingRef >= "Comic-Con" or headingRef < "Comic-Con") and authRefType==("Authorized" or "Auth/Ref") and headingType=="Personal Name" + summary: Search for "Authorized" or "Auth/Ref" personal name authority headings before and after "Comic-Con" \ No newline at end of file diff --git a/src/main/resources/swagger.api/parameters/authority-expand-all-param.yaml b/src/main/resources/swagger.api/parameters/authority-expand-all-param.yaml new file mode 100644 index 000000000..1c1bd1a2f --- /dev/null +++ b/src/main/resources/swagger.api/parameters/authority-expand-all-param.yaml @@ -0,0 +1,17 @@ +in: query +name: expandAll +description: | + Whether to return only basic properties or entire authority record.
+ Basic fields are: + - id + - tenantId + - shared + - headingType + - authRefType + - headingRef + - sourceFileId + - naturalId + - numberOfTitles +schema: + type: boolean + default: false 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 f62a0e04a..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,8 +3,4 @@ in: path required: true description: 'Browse option type' schema: - type: string - enum: - - all - - lc - - dewey + $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..9399a216a 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/entity/browseType.yaml' diff --git a/src/main/resources/swagger.api/parameters/call-number-type-param.yaml b/src/main/resources/swagger.api/parameters/call-number-type-param.yaml index c60e9004b..d704a2532 100644 --- a/src/main/resources/swagger.api/parameters/call-number-type-param.yaml +++ b/src/main/resources/swagger.api/parameters/call-number-type-param.yaml @@ -3,11 +3,4 @@ name: callNumberType description: Type of call number required: false schema: - type: string - enum: - - lc - - dewey - - nlm - - sudoc - - other - - local + $ref: '../schemas/entity/callNumberType.yaml' diff --git a/src/main/resources/swagger.api/parameters/instance-classification-browse-cql-query.yaml b/src/main/resources/swagger.api/parameters/instance-classification-browse-cql-query.yaml new file mode 100644 index 000000000..27360a890 --- /dev/null +++ b/src/main/resources/swagger.api/parameters/instance-classification-browse-cql-query.yaml @@ -0,0 +1,49 @@ +name: query +in: query +required: true +description: | + A CQL query string with filter conditions must include anchor query with range conditions. Anchor field is `number`. + Filters support logic operators `AND` and `OR`. All filters should be combined in parentheses. + Anchor will be included only if `<=` or `>=` are used in the query. Otherwise, the empty row will be added if `highlightMatch` is equal to `true`. + + + + + + + + + + + + + + + + + + + + + + + + +
+ Supported filter options +
OptionData typeSupported operatorsDescription
instances.tenantIdstring==Filter by tenant ID in consortium
instances.sharedboolean==Filter by shared/non-shared in consortium
+schema: + type: string +examples: + browseAround: + value: number >= "DT571.F84" or number < "DT571.F84" + summary: Search for all classification numbers before and after "DT571.F84" + browseForward: + value: number >= "DT571.F84" + summary: Search for all classification numbers after "DT571.F84" + browseBackward: + value: number >= "DT571.F84" + summary: Search for all classification numbers before "DT571.F84" + browseAroundWithFilters: + value: (number >= "DT571.F84" or number < "DT571.F84") and instances.shared==false + summary: Search for local classification numbers before and after "DT571.F84" \ No newline at end of file diff --git a/src/main/resources/swagger.api/parameters/instance-contributors-browse-cql-query.yaml b/src/main/resources/swagger.api/parameters/instance-contributors-browse-cql-query.yaml new file mode 100644 index 000000000..c76370aec --- /dev/null +++ b/src/main/resources/swagger.api/parameters/instance-contributors-browse-cql-query.yaml @@ -0,0 +1,55 @@ +name: query +in: query +required: true +description: | + A CQL query string with filter conditions must include anchor query with range conditions. Anchor field is `name`. + Filters support logic operators `AND` and `OR`. All filters should be combined in parentheses. + Anchor will be included only if `<=` or `>=` are used in the query. Otherwise, the empty row will be added if `highlightMatch` is equal to `true`. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Supported filter options +
OptionData typeSupported operatorsDescription
contributorNameTypeIduuid==Filter by contributor name type
instances.tenantIdstring==Filter by tenant ID in consortium
instances.sharedboolean==Filter by shared/non-shared in consortium
+schema: + type: string +examples: + browseAround: + value: name >= "Abedi, Ali" or name < "Abedi, Ali" + summary: Search for all contributor values before and after "Abedi, Ali" + browseForward: + value: name >= "Abedi, Ali" + summary: Search for all contributor values after "Abedi, Ali" + browseBackward: + value: name >= "Abedi, Ali" + summary: Search for all contributor values before "Abedi, Ali" + browseAroundWithFilters: + value: (name >= "Abedi, Ali" or name < "Abedi, Ali") and instances.shared==false and contributorNameTypeId="b6993450-25c1-4c23-a1d1-98abb67fb506" + summary: Search for local contributor values with name type id = "b6993450-25c1-4c23-a1d1-98abb67fb506" before and after "Abedi, Ali" \ No newline at end of file diff --git a/src/main/resources/swagger.api/parameters/instance-search-cql-query.yaml b/src/main/resources/swagger.api/parameters/instance-search-cql-query.yaml new file mode 100644 index 000000000..7fd8528d0 --- /dev/null +++ b/src/main/resources/swagger.api/parameters/instance-search-cql-query.yaml @@ -0,0 +1,624 @@ +name: query +in: query +required: true +description: | + A CQL query string +
Instance search options
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeExampleDescription
keywordfull-textkeyword all "web semantic"An alias for: title, alternativeTitles, indexTitle, series, identifiers.value, contributors.name
idtermid=="1234567"Matches instance with the id
hridtermhrid=="hr1*0"Matches instances with given HRID
sourcetermsource=="MARC"Matches instances with given source (FOLIO/MARC)
titlefull-texttitle all "semantic web"Matches instances with the given title, searches against title, alternativeTitles, + indexTitle, series fields +
alternativeTitles.alternativeTitlefull-textalternativeTitles.alternativeTitle all "semantic web"Matches instances with the given alternative title
uniformTitlefull-textuniformTitle all "semantic web"Matches instances with the given uniform title
indexTitlefull-textindexTitle all "semantic web"Matches instances with the given index title
seriesfull-textseries all "series"Matches instance with given series value
identifiers.valuetermidentifiers.value = "1023*"Matches instances with the given identifier value
identifiers.identifierTypeIdtermidentifiers.identifierTypeId=="123" identifiers.value = "1023*" + Matches instances that have an identifier of type 123 and ANY + identifier with value 1023* +
contributorsfull-textcontributors all "John"Matches instances that have a John contributor
contributors.nametermcontributors.name all "John"Matches instances that have a primary John contributor
contributors.contributorTypeIdtermcontributors.contributorTypeId all "1234567"Matches instances that have a contributor type Id 1234567
contributors.contributorNameTypeIdtermcontributors.contributorNameTypeId all "1234567"Matches instances that have a contributor name type Id 1234567
contributors.primarytermcontributors all "John" and contributors.primary==trueMatches instances that have a primary John contributor
contributors.authorityIdtermcontributors.authorityId == + "81ae0f60-f2bc-450c-84c8-5a21096daed9" + Matches instances that have a contributor authorityId 81ae0f60-f2bc-450c-84c8-5a21096daed9 +
authorityIdtermauthorityId == "81ae0f60-f2bc-450c-84c8-5a21096daed9"Matches instances that have a contributor authorityId 81ae0f60-f2bc-450c-84c8-5a21096daed9 +
subjectsfull-textsubjects all "Chemistry"Matches instances that have a Chemistry subject
instanceTypeIdterminstanceTypeId == "123"Matches instances with the 123 type
statusIdtermstatusId == "123"Matches instances with the 123 status
instanceFormatIdsterminstanceFormatIds == "123"Matches instances with the 123 format id
languagestermlanguages == "eng"Matches instances that have eng language
metadata.createdDatetermmetadata.createdDate > "2021-03-01T00:00:00.000+00:00" + Matches instances that were created after 2020-12-12
metadata.updatedDatetermmetadata.updatedDate > "2020-12-12"Matches instances that were updated after 2020-12-12
modeOfIssuanceIdtermmodeOfIssuanceId=="123"Matches instances that have 123 mode of issuance
natureOfContentTermIdstermnatureOfContentTermIds=="123"Matches instances that have 123 nature of content
publisherfull-textpublisher all "Publisher of Ukraine"Matches instances that have Publisher of Ukraine publisher
instanceTagsterminstanceTags=="important"Matches instances that have important tag
classifications.classificationNumbertermclassifications.classificationNumber=="cl1"Matches instances that have cl1 classification number
electronicAccessfull-textelectronicAccess any "resource"An alias for all electronicAccess fields - uri, linkText, + materialsSpecification, publicNote +
electronicAccess.uritermelectronicAccess.uri="http://folio.org*"Search by electronic access URI
electronicAccess.linkTextfull-textelectronicAccess.linkText="Folio website"Search by electronic access link text
electronicAccess.publicNotefull-textelectronicAccess.publicNote="a rare book"Search by electronic access public note
staffSuppresstermstaffSuppress==trueMatches instances that are staff suppressed
discoverySuppresstermdiscoverySuppress==trueMatches instances that are suppressed from discovery
publicNotesfull-textpublicNotes all "public note"Matches instances that have a public note (i.e. note.staffOnly is + false) +
administrativeNotesfull-textadministrativeNotes all "librarian note"Search by administrative notes
notes.notefull-textnotes.note all "librarian note"Search by instance notes (include staffOnly)
isbntermisbn="1234*"Matches instances that have an ISBN identifier with the given value
issntermissn="1234*"Matches instances that have an ISSN identifier with the given value
oclctermoclc="1234*"Matches instances that have an OCLC identifier with the given value
lccntermlccn = "LCCN"Matches instances with the given lccn
normalizedClassificationNumbertermnormalizedClassificationNumber == "LCCN"Matches instances with the given classification number (normalizes case, + whitespaces, special characters, supports leading and trailing wildcard) +
+
Holdings search options
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeExampleDescription
holdings.idtermholdings.id=="1234567"Matches instances that have a holding with the id
holdings.sourceIdtermholdings.sourceId=="FOLIO"Matches instances that have a holding with the source FOLIO
holdings.holdingsTypeIdtermholdings.holdingsTypeId=="1234567"Matches instances that have a holding with the holdings type id 1234567 +
holdings.permanentLocationIdtermholdings.permanentLocationId=="123765"Matches instances that have holdings with given statisticalCodeId
holdings.statisticalCodeIdstermholdings.statisticalCodeIds=="123765"Matches instances that have holdings with given permanentLocationId
holdings.discoverySuppresstermholdings.discoverySuppress==trueMatches instances that have holdings suppressed/not suppressed from discovery
holdings.hridtermholdings.hrid=="hr10*3"Matches instances that have a holding with given HRID
holdingsTagstermholdingsTags=="important"Matches instances that have holdings with given tags
holdingsFullCallNumberstermholdingsFullCallNumbers="cn*434"Matches instances that have holdings with given call number string (prefix + call + number + suffix) +
holdingsNormalizedCallNumberstermholdingsNormalizedCallNumbers="cn434"Matches instances that have holdings with given call number and might not be + formatted correctly +
holdings.electronicAccessfull-textholdings.electronicAccess any "resource"An alias for all electronicAccess fields - uri, linkText, + materialsSpecification, publicNote +
holdings.electronicAccess.uritermholdings.electronicAccess.uri="http://folio.org*"Search by electronic access URI
holdings.electronicAccess.linkTextfull-textholdings.electronicAccess.linkText="Folio website"Search by electronic access link text
holdings.electronicAccess.publicNotefull-textholdings.electronicAccess.publicNote="a rare book"Search by electronic access public note
holdings.administrativeNotesfull-textholdings.administrativeNotes all "librarian note"Search by holdings administrative notes
holdings.notes.notefull-textholdings.notes.note all "librarian note"Search by holdings notes
holdingsTypeIdtermholdingsTypeId=="123"Search by holdings type id
holdingsPublicNotesfull-textholdingsPublicNotes all "public note"Search by holdings public notes
holdingsIdentifierstermholdingsIdentifiers == "ho00000000006"Search by holdings Identifiers: holdings.id, holdings.hrid, + holdings.formerIds +
holdings.metadata.createdDatetermmetadata.createdDate > "2020-12-12"Matches instances with holdings that were created after 2020-12-12
holdings.metadata.updatedDatetermmetadata.updatedDate > "2020-12-12"Matches instances with holdings that were updated after 2020-12-12
+
Item search options
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeExampleDescription
item.idtermitem.id=="1234567"Matches instances that have an item with the id
item.hridtermitem.hrid=="it001"Matches instances that have an item with the HRID
item.barcodetermitem.barcode=="10011"Matches instances that have an item with the barcode
item.effectiveLocationIdtermitem.effectiveLocationId=="1212"Matches instances that have item with the effective location
item.statisticalCodeIdstermitem.statisticalCodeIds=="1212"Matches instances that have item with the statistical code Id
item.status.nametermitem.status.name=="Available"Matches instances that have item with given status
item.materialTypeIdtermitem.materialTypeId="23434"Matches instances that have item with given material type
item.discoverySuppresstermitem.discoverySuppress=trueMatches instances that have item suppressed/not suppressed from discovery
itemFullCallNumberstermitemFullCallNumbers="cn*434"Matches instances that have item with given call number string (prefix + call number + + suffix) +
itemNormalizedCallNumberstermitemNormalizedCallNumbers="cn434"Matches instances that have item with given call number and might not be formatted + correctly +
itemLevelCallNumberTypeIdterm + itemLevelCallNumberTypeId="81ae0f60-f2bc-450c-84c8-5a21096daed9" + Matches instances that have item with given call number type id
itemTagstermitemTags="important"Matches instances that have item with given tag
item.electronicAccessfull-textitem.electronicAccess any "resource"An alias for all electronicAccess fields - uri, linkText, + materialsSpecification, publicNote +
item.effectiveShelvingOrdertermitem.effectiveShelvingOrder="A 12"Matches instances that have item with given effectiveShelvingOrder + value +
item.electronicAccess.uritermitem.electronicAccess.uri="http://folio.org*"Search by electronic access URI
item.electronicAccess.linkTextfull-textitem.electronicAccess.linkText="Folio website"Search by electronic access link text
item.electronicAccess.publicNotefull-textitem.electronicAccess.publicNote="a rare book"Search by electronic access public note
item.administrativeNotesfull-textitem.administrativeNotes all "librarian note"Search by item administrative notes
item.notes.notefull-textitem.notes.note all "librarian note"Search by item notes and circulation notes
item.circulationNotes.notefull-textitem.circulationNotes.note all "circulation note"Search by item circulation notes
itemPublicNotesfull-textitemPublicNotes all "public note"Search by item public notes and circulation notes
itemIdentifierstermitemIdentifiers all "81ae0f60-f2bc-450c-84c8-5a21096daed9" + Search by item Identifiers: item.id, item.hrid, item.formerIds, + item.accessionNumber, item.itemIdentifier +
item.metadata.createdDatetermitem.metadata.createdDate > "2020-12-12"Matches instances with item that were created after 2020-12-12
item.metadata.updatedDatetermitem.metadata.updatedDate > "2020-12-12"Matches instances with item that were updated after 2020-12-12
callNumberTypetermcallNumberType = "lc"Matches instances with item that has call number with type Library of Congress classification. Supported values: lc, dewey, nlm, sudoc, other, local.
+schema: + type: string \ No newline at end of file diff --git a/src/main/resources/swagger.api/parameters/instance-subjects-browse-cql-query.yaml b/src/main/resources/swagger.api/parameters/instance-subjects-browse-cql-query.yaml new file mode 100644 index 000000000..e234e4f53 --- /dev/null +++ b/src/main/resources/swagger.api/parameters/instance-subjects-browse-cql-query.yaml @@ -0,0 +1,49 @@ +name: query +in: query +required: true +description: | + A CQL query string with filter conditions must include anchor query with range conditions. Anchor field is `value`. + Filters support logic operators `AND` and `OR`. All filters should be combined in parentheses. + Anchor will be included only if `<=` or `>=` are used in the query. Otherwise, the empty row will be added if `highlightMatch` is equal to `true`. + + + + + + + + + + + + + + + + + + + + + + + + +
+ Supported filter options +
OptionData typeSupported operatorsDescription
instances.tenantIdstring==Filter by tenant ID in consortium
instances.sharedboolean==Filter by shared/non-shared in consortium
+schema: + type: string +examples: + browseAround: + value: value >= "Fantasy" or value < "Fantasy" + summary: Search for all subject values before and after "Fantasy" + browseForward: + value: value >= "Fantasy" + summary: Search for all subject values after "Fantasy" + browseBackward: + value: value >= "Fantasy" + summary: Search for all subject values before "Fantasy" + browseAroundWithFilters: + value: (value >= "Fantasy" or value < "Fantasy") and instances.shared==false + summary: Search for local subject values before and after "Fantasy" \ No newline at end of file diff --git a/src/main/resources/swagger.api/parameters/preceding-records-count.yaml b/src/main/resources/swagger.api/parameters/preceding-records-count.yaml index 548b65453..a9bf4c311 100644 --- a/src/main/resources/swagger.api/parameters/preceding-records-count.yaml +++ b/src/main/resources/swagger.api/parameters/preceding-records-count.yaml @@ -1,6 +1,6 @@ in: query name: precedingRecordsCount -description: Number of preceding records for browsing around and around-including options +description: Number of preceding records for browsing around and around-including queries required: false schema: type: integer diff --git a/src/main/resources/swagger.api/parameters/record-type.yaml b/src/main/resources/swagger.api/parameters/record-type.yaml index 5cda3a827..7de5c9efd 100644 --- a/src/main/resources/swagger.api/parameters/record-type.yaml +++ b/src/main/resources/swagger.api/parameters/record-type.yaml @@ -1,11 +1,6 @@ name: recordType +description: "Type of record to get facets for." required: true in: path schema: - type: string - enum: - - instances - - authorities - - contributors - - subjects - - classifications + $ref: "../schemas/entity/recordType.yaml" diff --git a/src/main/resources/swagger.api/parameters/sort-order-param.yaml b/src/main/resources/swagger.api/parameters/sort-order-param.yaml index 4cd4bf53f..946231a1d 100644 --- a/src/main/resources/swagger.api/parameters/sort-order-param.yaml +++ b/src/main/resources/swagger.api/parameters/sort-order-param.yaml @@ -3,7 +3,4 @@ name: sortOrder description: 'Defines sorting order' required: false schema: - type: string - enum: - - asc - - desc + $ref: '../schemas/entity/sortOrder.yaml' diff --git a/src/main/resources/swagger.api/parameters/tenant-id-query-param.yaml b/src/main/resources/swagger.api/parameters/tenant-id-query-param.yaml index 1de53fd9f..aebc77e35 100644 --- a/src/main/resources/swagger.api/parameters/tenant-id-query-param.yaml +++ b/src/main/resources/swagger.api/parameters/tenant-id-query-param.yaml @@ -1,6 +1,6 @@ in: query name: tenantId -description: Tenant ID +description: "Tenant ID to filter by" required: false schema: type: string 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 11b90921c..c3c12b8be 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 @@ -1,24 +1,30 @@ get: operationId: browseAuthorities + summary: Browse Authorities description: Provides list of authorities by headingRef tags: - browse parameters: - - $ref: '../../parameters/cql-query.yaml' - - $ref: '../../parameters/limit-param.yaml' - - $ref: '../../parameters/expand-all-param.yaml' - - $ref: '../../parameters/x-okapi-tenant-header.yaml' + - $ref: '../../parameters/authority-browse-cql-query.yaml' + - $ref: '../../parameters/authority-expand-all-param.yaml' - $ref: '../../parameters/highlight-match.yaml' - $ref: '../../parameters/preceding-records-count.yaml' + - $ref: '../../parameters/limit-param.yaml' + - $ref: '../../parameters/x-okapi-tenant-header.yaml' responses: '200': description: 'Search result for browsing by authorities' content: application/json: - example: - $ref: '../../examples/result/browseAuthorityResult.yaml' schema: $ref: '../../schemas/response/authorityBrowseResult.yaml' + examples: + browseResult: + $ref: '../../examples/response/browseAuthorityResponse.yaml' + browseEmptyResult: + $ref: '../../examples/response/browseAuthorityEmptyResponse.yaml' + browseExpandedResult: + $ref: '../../examples/response/browseAuthorityExpandedResponse.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': 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 9c9115e3b..bd70218b1 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 @@ -1,6 +1,8 @@ get: operationId: browseInstancesByCallNumber + summary: Browse Call Numbers description: Provides list of instances for browsing by call number + deprecated: true tags: - browse parameters: @@ -16,8 +18,9 @@ get: description: 'Search result for browsing by call number' content: application/json: - example: - $ref: '../../examples/result/browseCallNumberResult.yaml' + examples: + browseResult: + $ref: '../../examples/result/browseCallNumberResult.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-instance-classifications.yaml similarity index 69% rename from src/main/resources/swagger.api/paths/browse-classification-numbers/browse-option-id-instances.yaml rename to src/main/resources/swagger.api/paths/browse-classification-numbers/browse-instance-classifications.yaml index 29fc453ef..dcbc7f9cb 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-instance-classifications.yaml @@ -1,13 +1,13 @@ get: operationId: browseInstancesByClassificationNumber - description: Provides list of instances for browsing by classification number + summary: Browse Instance Classifications + description: Provides list of classifications by classification number tags: - browse parameters: - $ref: '../../parameters/browse-option-id.yaml' - - $ref: '../../parameters/cql-query.yaml' + - $ref: '../../parameters/instance-classification-browse-cql-query.yaml' - $ref: '../../parameters/browse-limit-param.yaml' - - $ref: '../../parameters/expand-all-param.yaml' - $ref: '../../parameters/highlight-match.yaml' - $ref: '../../parameters/preceding-records-count.yaml' - $ref: '../../parameters/x-okapi-tenant-header.yaml' @@ -16,8 +16,9 @@ get: description: 'Search result for browsing by call number' content: application/json: - example: - $ref: '../../examples/result/browseClassificationNumberResult.yaml' + examples: + browseResult: + $ref: '../../examples/result/browseClassificationNumberResult.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 42ddda3f4..4c490433c 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 @@ -1,5 +1,6 @@ put: operationId: putBrowseConfig + summary: Update Browse Configurations description: Update configuration for browse type tags: - config @@ -12,9 +13,12 @@ put: application/json: schema: $ref: '../../schemas/entity/browseConfig.yaml' + examples: + updateRequest: + $ref: '../../examples/request/browseConfigUpdateRequest.yaml' responses: '200': - description: Browse configuration has been added/updated. + description: Browse configuration has been updated. '400': $ref: '../../responses/badRequestResponse.yaml' '422': 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 aaee93f61..eacf4533e 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 @@ -1,5 +1,6 @@ get: operationId: getBrowseConfigs + summary: Get Browse Configurations description: Get all configurations for browse type tags: - config @@ -12,3 +13,6 @@ get: application/json: schema: $ref: '../../schemas/entity/browseConfigCollection.yaml' + examples: + configCollection: + $ref: "../../examples/response/browseConfigCollectionResponse.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 51dc0131b..eaf15c235 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 @@ -1,10 +1,11 @@ get: operationId: browseInstancesByContributor + summary: Browse Instance Contributors description: Provides list of instances for browsing by contributor tags: - browse parameters: - - $ref: '../../parameters/cql-query.yaml' + - $ref: '../../parameters/instance-contributors-browse-cql-query.yaml' - $ref: '../../parameters/limit-param.yaml' - $ref: '../../parameters/x-okapi-tenant-header.yaml' - $ref: '../../parameters/highlight-match.yaml' @@ -14,8 +15,9 @@ get: description: 'Search result for browsing by contributor' content: application/json: - example: - $ref: '../../examples/result/browseContributorsResult.yaml' + examples: + browseResult: + $ref: '../../examples/result/browseContributorsResult.yaml' schema: $ref: '../../schemas/response/contributorBrowseResult.yaml' '400': 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 eb64aae57..1f43fbaff 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 @@ -1,10 +1,11 @@ get: operationId: browseInstancesBySubject + summary: Browse Instance Subjects description: Provides list of instances for browsing by subject tags: - browse parameters: - - $ref: '../../parameters/cql-query.yaml' + - $ref: '../../parameters/instance-subjects-browse-cql-query.yaml' - $ref: '../../parameters/limit-param.yaml' - $ref: '../../parameters/x-okapi-tenant-header.yaml' - $ref: '../../parameters/highlight-match.yaml' @@ -14,8 +15,9 @@ get: description: 'Search result for browsing by call number' content: application/json: - example: - $ref: '../../examples/result/browseSubjectResult.yaml' + examples: + browseResult: + $ref: '../../examples/result/browseSubjectResult.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 d558a3016..449e92e96 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 @@ -1,5 +1,6 @@ get: operationId: searchAuthorities + summary: Search Authorities description: Get a list of authorities for CQL query tags: - search @@ -15,10 +16,11 @@ get: description: 'Authorities search result' content: application/json: - example: - $ref: '../../examples/result/searchResult.yaml' schema: $ref: '../../schemas/response/authoritySearchResult.yaml' + examples: + searchResult: + $ref: '../../examples/result/authoritySearchResult.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '500': 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 ccc5042b4..5639d87ee 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 @@ -1,5 +1,6 @@ put: operationId: updateFeatureConfiguration + summary: Update Feature Configuration description: Update feature configuration settings tags: - config @@ -10,6 +11,9 @@ put: application/json: schema: $ref: '../../schemas/entity/featureConfig.yaml' + examples: + updateRequest: + $ref: '../../examples/request/updateCreateFeatureRequest.yaml' responses: '200': description: Feature configuration has been added. @@ -17,12 +21,16 @@ put: application/json: schema: $ref: '../../schemas/entity/featureConfig.yaml' + examples: + updateResponse: + $ref: '../../examples/response/updateFeatureResponse.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '422': $ref: '../../responses/unprocessableEntityResponse.yaml' delete: operationId: deleteFeatureConfigurationById + summary: Delete Feature Configuration description: Delete feature configuration by id tags: - config 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 bd274da32..29f686533 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 @@ -1,5 +1,6 @@ post: operationId: saveFeatureConfiguration + summary: Save Feature Configuration description: Save feature configuration (enables or disables pre-defined optional search options) tags: - config @@ -8,6 +9,9 @@ post: application/json: schema: $ref: '../../schemas/entity/featureConfig.yaml' + examples: + createRequest: + $ref: '../../examples/request/updateCreateFeatureRequest.yaml' responses: '200': description: Language support has been added. @@ -15,12 +19,16 @@ post: application/json: schema: $ref: '../../schemas/entity/featureConfig.yaml' + examples: + createResponse: + $ref: '../../examples/response/updateFeatureResponse.yaml' '400': $ref: '../../responses/badRequestResponse.yaml' '422': $ref: '../../responses/unprocessableEntityResponse.yaml' get: operationId: getAllFeatures + summary: Get Feature Configurations description: Get all feature configurations per tenant tags: - config @@ -31,3 +39,10 @@ get: application/json: schema: $ref: '../../schemas/entity/featureConfigs.yaml' + examples: + allFeaturesResponse: + value: + features: + - feature: "search.all.fields" + enabled: false + totalRecords: 1 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 5cf32bcae..d63994c86 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 @@ -1,5 +1,6 @@ put: operationId: updateLanguageConfig + summary: Update Language Configuration description: Update language config settings tags: - config @@ -10,6 +11,11 @@ put: application/json: schema: $ref: '../../schemas/entity/languageConfig.yaml' + examples: + updateLanguageConfigRequest: + value: + code: eng + languageAnalyzer: eng-analyzer responses: '200': description: Language support has been added. @@ -17,10 +23,16 @@ put: application/json: schema: $ref: '../../schemas/entity/languageConfig.yaml' + examples: + updateLanguageConfigResponse: + value: + code: eng + languageAnalyzer: eng-analyzer '422': $ref: '../../responses/unprocessableEntityResponse.yaml' delete: operationId: deleteLanguageConfig + summary: Delete Language Configuration description: Delete all supported languages tags: - config 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 820e3592d..34fecdef9 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 @@ -1,5 +1,6 @@ post: operationId: createLanguageConfig + summary: Create Language Configuration description: Save languages that will be used for analyzers tags: - config @@ -8,6 +9,11 @@ post: application/json: schema: $ref: '../../schemas/entity/languageConfig.yaml' + examples: + createLanguageConfigRequest: + value: + code: eng + languageAnalyzer: eng-analyzer responses: '200': description: Language support has been added. @@ -15,10 +21,16 @@ post: application/json: schema: $ref: '../../schemas/entity/languageConfig.yaml' + examples: + createLanguageConfigResponse: + value: + code: eng + languageAnalyzer: eng-analyzer '422': $ref: '../../responses/unprocessableEntityResponse.yaml' get: operationId: getAllLanguageConfigs + summary: Get Language Configurations description: Get all supported languages tags: - config @@ -29,3 +41,12 @@ get: application/json: schema: $ref: '../../schemas/entity/languageConfigs.yaml' + examples: + languageConfigsResponse: + value: + languageConfigs: + - code: eng + languageAnalyzer: eng-analyzer + - code: ukr + languageAnalyzer: ukr-analyzer + totalRecords: 2 \ No newline at end of file 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 fca6b0f9c..4de153d02 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 @@ -1,5 +1,6 @@ get: operationId: getConsortiumHoldings + summary: Get Consolidated Holdings description: Get a list of holdings (only for consortium environment) tags: - search-consortium @@ -18,6 +19,9 @@ get: application/json: schema: $ref: '../../schemas/entity/consortiumHoldingCollection.yaml' + examples: + consortiumHoldingsCollectionResponse: + $ref: '../../examples/response/consortiumHoldingsCollectionResponse.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 dc49c0013..5042dcc5c 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 @@ -1,5 +1,6 @@ get: operationId: getConsortiumItems + summary: Get Consolidated Items description: Get a list of items (only for consortium environment) tags: - search-consortium @@ -19,6 +20,9 @@ get: application/json: schema: $ref: '../../schemas/entity/consortiumItemCollection.yaml' + examples: + consortiumItemCollection: + $ref: '../../examples/response/consortiumItemCollectionResponse.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 1aa604634..62c4b543d 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 @@ -1,5 +1,6 @@ get: operationId: getFacets + summary: Get Facets description: Provides list of facets for the record type tags: - facets @@ -13,8 +14,9 @@ get: description: 'Facet search result' content: application/json: - example: - $ref: '../../examples/result/facetResult.yaml' + examples: + facetResult: + $ref: '../../examples/result/facetResult.yaml' schema: $ref: '../../schemas/response/facetResult.yaml' '400': 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 941d24c8e..512ee2c79 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 @@ -1,6 +1,8 @@ get: operationId: getHoldingIds + summary: Get Holdings IDs description: Get a list of holding ids linked to instances found by the CQL query + deprecated: true tags: - search-resources-ids parameters: @@ -12,11 +14,13 @@ get: description: 'Instance ids as json stream' content: application/json: - example: - $ref: '../../examples/result/HoldingIdsResult.yaml' + examples: + HoldingIdsResult: + $ref: '../../examples/result/HoldingIdsResult.yaml' application/text: - example: - $ref: '../../examples/result/IdsTextResult.yaml' + examples: + IdsTextResult: + $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 da52e75fc..a80b0ef3e 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 @@ -1,5 +1,6 @@ post: operationId: createIndices + summary: Create Index description: Creates indices for passed resource name and tenant id in request header. tags: - index-management @@ -20,6 +21,9 @@ post: application/json: schema: $ref: '../../schemas/response/folioCreateIndexResponse.yaml' + examples: + indexOperationResponse: + $ref: '../../examples/response/indexOperationResponse.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 33f0cc61d..b52820e07 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 @@ -1,13 +1,15 @@ post: operationId: reindexInventoryRecords + summary: Re-Index description: Initiates reindex for the inventory records tags: - index-management requestBody: content: application/json: - example: - $ref: '../../examples/request/reindexRequest.yaml' + examples: + reindexRequest: + $ref: '../../examples/request/reindexRequest.yaml' schema: $ref: '../../schemas/request/reindexRequest.yaml' parameters: @@ -19,5 +21,8 @@ post: application/json: schema: $ref: '../../schemas/entity/reindexJob.yaml' + examples: + reindexJobResponse: + $ref: '../../examples/response/reindexJobResponse.yaml' '500': $ref: '../../responses/internalServerErrorResponse.yaml' diff --git a/src/main/resources/swagger.api/paths/search-index/search-index-mappings.yaml b/src/main/resources/swagger.api/paths/search-index/search-index-mappings.yaml index 21ede159d..1654b3f7f 100644 --- a/src/main/resources/swagger.api/paths/search-index/search-index-mappings.yaml +++ b/src/main/resources/swagger.api/paths/search-index/search-index-mappings.yaml @@ -1,5 +1,6 @@ post: operationId: updateMappings + summary: Create Index Mappings description: Creates mappings for passed resource name and tenant id in request header. tags: - index-management @@ -10,6 +11,9 @@ post: application/json: schema: $ref: '../../schemas/request/updateMappingsRequest.yaml' + examples: + updateMappingsRequest: + $ref: '../../examples/request/updateMappingsRequest.yaml' responses: '200': description: Response with created indices and status (error message will be present if operation failed) @@ -17,5 +21,8 @@ post: application/json: schema: $ref: '../../schemas/response/folioIndexOperationResponse.yaml' + examples: + indexOperationResponse: + $ref: '../../examples/response/indexOperationResponse.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 b2b461698..ac0cadb0a 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 @@ -1,23 +1,29 @@ post: operationId: indexRecords + summary: Index Records description: Indexes the records into elasticsearch. tags: - index-management requestBody: content: application/json: - example: - $ref: '../../examples/request/indexRecordRequestBody.yaml' + examples: + indexRecordsRequest: + $ref: '../../examples/request/indexRecordsRequest.yaml' schema: - $ref: '../../schemas/request/indexRecordRequest.yaml' + type: array + items: + $ref: '../../schemas/entity/resourceEvent.yaml' responses: '200': description: Response with created indices and status (error message will be present if operation failed) content: application/json: examples: - indexRecordResponse: - $ref: '../../examples/response/indexRecordResponse.yaml' + successResponse: + $ref: '../../examples/response/indexRecordSuccessResponse.yaml' + failureResponse: + $ref: '../../examples/response/indexRecordFailureResponse.yaml' schema: $ref: '../../schemas/response/folioIndexOperationResponse.yaml' '500': 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 608c4f16a..e6dddbd65 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 @@ -1,5 +1,6 @@ put: operationId: updateIndexDynamicSettings + summary: Update Index Settings description: Update Index Dynamic Settings data. tags: - index-management @@ -10,6 +11,9 @@ put: application/json: schema: $ref: '../../schemas/request/updateIndexDynamicSettingsRequest.yaml' + examples: + updateRequest: + $ref: '../../examples/request/updateIndexSettingsRequest.yaml' responses: '200': description: Response with updated index settings and status (error message will be present if operation failed) @@ -17,5 +21,8 @@ put: application/json: schema: $ref: '../../schemas/response/folioIndexOperationResponse.yaml' + examples: + indexOperationResponse: + $ref: '../../examples/response/indexOperationResponse.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 52bba0c7b..68fefde3a 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 @@ -1,6 +1,8 @@ get: operationId: getInstanceIds + summary: Get Instance IDs description: Get a list of instance ids for CQL query + deprecated: true tags: - search-resources-ids parameters: @@ -12,11 +14,13 @@ get: description: 'Instance ids as json stream' content: application/json: - example: - $ref: '../../examples/result/InstanceIdsResult.yaml' + examples: + InstanceIdsResult: + $ref: '../../examples/result/InstanceIdsResult.yaml' application/text: - example: - $ref: '../../examples/result/IdsTextResult.yaml' + examples: + IdsTextResult: + $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 ff2515614..506bd8e52 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 @@ -1,11 +1,12 @@ get: operationId: searchInstances + summary: Search Instances description: Get a list of instances for CQL query tags: - search parameters: - $ref: '../../parameters/x-okapi-tenant-header.yaml' - - $ref: '../../parameters/cql-query.yaml' + - $ref: '../../parameters/instance-search-cql-query.yaml' - $ref: '../../parameters/limit-param.yaml' - $ref: '../../parameters/offset-param.yaml' - $ref: '../../parameters/expand-all-param.yaml' @@ -14,8 +15,9 @@ get: description: 'Instance search result' content: application/json: - example: - $ref: '../../examples/result/searchResult.yaml' + examples: + searchResult: + $ref: '../../examples/result/instanceSearchResult.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 fe68f7209..acc22752b 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 @@ -1,5 +1,6 @@ get: operationId: getResourceIds + summary: Get Resource IDs description: Get a list of resource ids by job id tags: - search-resources-ids @@ -11,8 +12,9 @@ get: description: 'Resources ids as a json stream' content: application/json: - example: - $ref: '../../examples/result/resourceIdsResult.yaml' + examples: + idsResponse: + $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 57a372133..547af6aae 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 @@ -1,5 +1,6 @@ get: operationId: getIdsJob + summary: Get Job description: Get a job for the stream of resource ids. tags: - search-resources-ids 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 145828d7f..59c479d16 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 @@ -1,5 +1,6 @@ post: operationId: submitIdsJob + summary: Trigger new Job description: Creates a job for the stream of resource ids. tags: - search-resources-ids diff --git a/src/main/resources/swagger.api/responses/badRequestResponse.yaml b/src/main/resources/swagger.api/responses/badRequestResponse.yaml index cb35f8c3b..b33460f90 100644 --- a/src/main/resources/swagger.api/responses/badRequestResponse.yaml +++ b/src/main/resources/swagger.api/responses/badRequestResponse.yaml @@ -1,7 +1,8 @@ description: Validation errors content: application/json: - example: - $ref: "../examples/response/validationErrorResponse.yaml" schema: $ref: "../schemas/response/errorResponse.yaml" + examples: + validationErrorResponse: + $ref: "../examples/response/validationErrorResponse.yaml" \ No newline at end of file diff --git a/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml b/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml index baef976f1..878d23d12 100644 --- a/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml +++ b/src/main/resources/swagger.api/responses/internalServerErrorResponse.yaml @@ -1,5 +1,8 @@ -description: When unhandled exception occurred during code execution, e.g. NullPointerException +description: When unhandled exception occurred during code execution, e.g. NullPointerException. content: application/json: - example: - $ref: "../examples/response/unknownError.yaml" + schema: + $ref: "../schemas/response/errorResponse.yaml" + examples: + unknownError: + $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 22eef72eb..66c106d0f 100644 --- a/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml +++ b/src/main/resources/swagger.api/responses/unprocessableEntityResponse.yaml @@ -3,3 +3,6 @@ content: application/json: schema: $ref: '../schemas/response/errorResponse.yaml' + examples: + response: + $ref: '../examples/response/validationErrorResponse.yaml' \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/entity/authority.yaml b/src/main/resources/swagger.api/schemas/dto/authority/authority.yaml similarity index 93% rename from src/main/resources/swagger.api/schemas/entity/authority.yaml rename to src/main/resources/swagger.api/schemas/dto/authority/authority.yaml index bf7f3c65f..4423cf421 100644 --- a/src/main/resources/swagger.api/schemas/entity/authority.yaml +++ b/src/main/resources/swagger.api/schemas/dto/authority/authority.yaml @@ -13,6 +13,12 @@ properties: source: type: "string" description: "The metadata source and its format of the underlying record to the authority record" + sourceFileId: + type: "string" + description: "Authority source file id; UUID" + naturalId: + type: "string" + description: "Authority Natural ID" personalName: type: "string" description: "Heading personal name" @@ -164,22 +170,14 @@ properties: type: "array" description: "An extensible set of name-value pairs of identifiers associated with the resource" items: - $ref: "identifiers.yaml" + $ref: "../common/identifier.yaml" 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" + $ref: "authorityNote.yaml" metadata: - type: "object" - description: "Creater, updater, creation date, last updated date" - $ref: "metadata.yaml" + $ref: "../common/metadata.yaml" headingType: type: "string" description: "Generated field by mod-search, used to easily identity the heading type of the record that provides authority information" @@ -191,10 +189,4 @@ properties: 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" + description: "Generated field by mod-search, used to count the total number of bib records linked to this authority record" \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/dto/authority/authorityNote.yaml b/src/main/resources/swagger.api/schemas/dto/authority/authorityNote.yaml new file mode 100644 index 000000000..4db81fde9 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/dto/authority/authorityNote.yaml @@ -0,0 +1,7 @@ +type: "object" +properties: + noteTypeId: + description: "ID of the type of note" + note: + type: "string" + description: "Text content of the note" \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/entity/identifiers.yaml b/src/main/resources/swagger.api/schemas/dto/common/identifier.yaml similarity index 91% rename from src/main/resources/swagger.api/schemas/entity/identifiers.yaml rename to src/main/resources/swagger.api/schemas/dto/common/identifier.yaml index 2165c8176..eb64dcdfb 100644 --- a/src/main/resources/swagger.api/schemas/entity/identifiers.yaml +++ b/src/main/resources/swagger.api/schemas/dto/common/identifier.yaml @@ -1,5 +1,6 @@ type: object description: "Resource identifier" +additionalProperties: false properties: value: type: string diff --git a/src/main/resources/swagger.api/schemas/entity/metadata.yaml b/src/main/resources/swagger.api/schemas/dto/common/metadata.yaml similarity index 96% rename from src/main/resources/swagger.api/schemas/entity/metadata.yaml rename to src/main/resources/swagger.api/schemas/dto/common/metadata.yaml index 1fb0dba96..94176756a 100644 --- a/src/main/resources/swagger.api/schemas/entity/metadata.yaml +++ b/src/main/resources/swagger.api/schemas/dto/common/metadata.yaml @@ -1,5 +1,6 @@ type: object description: "Record metadata" +additionalProperties: false properties: createdDate: description: "Date and time when the record was created" diff --git a/src/main/resources/swagger.api/schemas/entity/tags.yaml b/src/main/resources/swagger.api/schemas/dto/common/tags.yaml similarity index 92% rename from src/main/resources/swagger.api/schemas/entity/tags.yaml rename to src/main/resources/swagger.api/schemas/dto/common/tags.yaml index cd030c38e..e3cfdee2e 100644 --- a/src/main/resources/swagger.api/schemas/entity/tags.yaml +++ b/src/main/resources/swagger.api/schemas/dto/common/tags.yaml @@ -1,4 +1,3 @@ -id: "tags.schema" title: "tags" description: "List of simple tags that can be added to an object" type: "object" diff --git a/src/main/resources/swagger.api/schemas/entity/alternativeTitle.yaml b/src/main/resources/swagger.api/schemas/dto/instance/alternativeTitle.yaml similarity index 93% rename from src/main/resources/swagger.api/schemas/entity/alternativeTitle.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/alternativeTitle.yaml index 02d31e560..05419d0fc 100644 --- a/src/main/resources/swagger.api/schemas/entity/alternativeTitle.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/alternativeTitle.yaml @@ -1,5 +1,6 @@ type: object description: "An alternative title description" +additionalProperties: false properties: alternativeTitleTypeId: type: string diff --git a/src/main/resources/swagger.api/schemas/entity/circulationNote.yaml b/src/main/resources/swagger.api/schemas/dto/instance/circulationNote.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/entity/circulationNote.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/circulationNote.yaml diff --git a/src/main/resources/swagger.api/schemas/dto/instance/classification.yaml b/src/main/resources/swagger.api/schemas/dto/instance/classification.yaml new file mode 100644 index 000000000..b939d814d --- /dev/null +++ b/src/main/resources/swagger.api/schemas/dto/instance/classification.yaml @@ -0,0 +1,9 @@ +type: object +description: Classification object +properties: + classificationNumber: + description: "Classification (e.g. classification scheme, classification schedule)" + type: string + classificationTypeId: + description: "Classification type ID" + type: string \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/entity/contributor.yaml b/src/main/resources/swagger.api/schemas/dto/instance/contributor.yaml similarity index 96% rename from src/main/resources/swagger.api/schemas/entity/contributor.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/contributor.yaml index a13436c8a..756d0a60a 100644 --- a/src/main/resources/swagger.api/schemas/entity/contributor.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/contributor.yaml @@ -1,5 +1,6 @@ type: object description: "A contributor description" +additionalProperties: false properties: name: type: string diff --git a/src/main/resources/swagger.api/schemas/entity/electronicAccess.yaml b/src/main/resources/swagger.api/schemas/dto/instance/electronicAccess.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/entity/electronicAccess.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/electronicAccess.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/holding.yaml b/src/main/resources/swagger.api/schemas/dto/instance/holding.yaml similarity index 94% rename from src/main/resources/swagger.api/schemas/entity/holding.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/holding.yaml index 11da1d348..469e4545c 100644 --- a/src/main/resources/swagger.api/schemas/entity/holding.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/holding.yaml @@ -31,8 +31,7 @@ properties: type: string description: "UUID for a statistical code" tags: - description: "arbitrary tags associated with this holding" - $ref: "tags.yaml" + $ref: "../common/tags.yaml" holdingsTypeId: type: string description: "unique ID for the type of this holdings record, a UUID" @@ -64,7 +63,7 @@ properties: items: $ref: "note.yaml" metadata: - $ref: "metadata.yaml" + $ref: "../common/metadata.yaml" required: - electronicAccess - notes diff --git a/src/main/resources/swagger.api/schemas/dto/instance/instanceBasicSearchResultItem.yaml b/src/main/resources/swagger.api/schemas/dto/instance/instanceBasicSearchResultItem.yaml new file mode 100644 index 000000000..d9493b540 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/dto/instance/instanceBasicSearchResultItem.yaml @@ -0,0 +1,35 @@ +type: object +description: "Instance basic search result item" +additionalProperties: false +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 + title: + description: "The primary title (or label) associated with the resource" + type: string + contributors: + type: array + description: "List of contributors names" + items: + $ref: "contributor.yaml" + publication: + description: "List of publication items" + type: array + items: + $ref: 'publication.yaml' + staffSuppress: + description: "Records the fact that the record should not be displayed for others than catalogers" + type: boolean + discoverySuppress: + description: "Records the fact that the record should not be displayed in a discovery system" + type: boolean + isBoundWith: + description: "Indicates if this instance is included in a bound-with" + type: boolean \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/dto/instance/instanceFullSearchResultItem.yaml b/src/main/resources/swagger.api/schemas/dto/instance/instanceFullSearchResultItem.yaml new file mode 100644 index 000000000..56721b456 --- /dev/null +++ b/src/main/resources/swagger.api/schemas/dto/instance/instanceFullSearchResultItem.yaml @@ -0,0 +1,129 @@ +type: object +description: "instance description" +additionalProperties: false +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: + description: "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" + type: string + source: + 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)" + type: string + statisticalCodeIds: + description: "List of statistical code IDs" + type: array + items: + description: "UUID for a statistical code" + type: string + statusId: + description: "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)" + type: string + title: + description: "The primary title (or label) associated with the resource" + type: string + indexTitle: + description: "Title normalized for browsing and searching; based on the title with articles removed" + type: string + series: + description: "List of series titles associated with the resource (e.g. Harry Potter)" + type: array + items: + $ref: "seriesItem.yaml" + alternativeTitles: + type: array + description: "List of alternative titles for the resource (e.g. original language version title of a movie)" + items: + $ref: "alternativeTitle.yaml" + identifiers: + type: array + description: "Resource identifier value array" + items: + $ref: "../common/identifier.yaml" + contributors: + type: array + description: "List of contributors names" + items: + $ref: "contributor.yaml" + subjects: + type: array + description: "List of subject headings" + items: + $ref: "subject.yaml" + instanceTypeId: + description: "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined" + type: string + instanceFormatIds: + description: "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined" + type: array + items: + type: string + languages: + description: "The set of languages used by the resource" + type: array + items: + type: string + metadata: + $ref: "../common/metadata.yaml" + administrativeNotes: + type: array + description: "Administrative notes" + items: + type: string + modeOfIssuanceId: + 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)" + type: string + natureOfContentTermIds: + description: "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)" + type: array + items: + description: "Single UUID for the Instance nature of content" + type: string + publication: + description: "List of publication items" + type: array + items: + $ref: 'publication.yaml' + staffSuppress: + description: "Records the fact that the record should not be displayed for others than catalogers" + type: boolean + discoverySuppress: + description: "Records the fact that the record should not be displayed in a discovery system" + type: boolean + isBoundWith: + description: "Indicates if this instance is included in a bound-with" + type: boolean + tags: + $ref: "../common/tags.yaml" + classifications: + type: array + description: "List of classifications" + items: + $ref: "classification.yaml" + electronicAccess: + description: "List of electronic access items" + type: array + items: + $ref: "electronicAccess.yaml" + notes: + description: "Bibliographic notes (e.g. general notes, specialized notes), and administrative notes" + type: array + items: + $ref: "note.yaml" + items: + description: "List of instance items" + type: array + items: + $ref: "item.yaml" + holdings: + description: "List of instance holding records" + type: array + items: + $ref: "holding.yaml" diff --git a/src/main/resources/swagger.api/schemas/entity/item.yaml b/src/main/resources/swagger.api/schemas/dto/instance/item.yaml similarity index 96% rename from src/main/resources/swagger.api/schemas/entity/item.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/item.yaml index 1ac47d3f7..5dde0e4f7 100644 --- a/src/main/resources/swagger.api/schemas/entity/item.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/item.yaml @@ -66,8 +66,7 @@ properties: type: string description: "Call number type id" tags: - description: "arbitrary tags associated with this item" - $ref: 'tags.yaml' + $ref: "../common/tags.yaml" electronicAccess: type: array description: "List of electronic access items" @@ -95,6 +94,6 @@ properties: items: $ref: "circulationNote.yaml" metadata: - $ref: "metadata.yaml" + $ref: "../common/metadata.yaml" required: - notes diff --git a/src/main/resources/swagger.api/schemas/entity/note.yaml b/src/main/resources/swagger.api/schemas/dto/instance/note.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/entity/note.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/note.yaml diff --git a/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml b/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml new file mode 100644 index 000000000..f1cd69caa --- /dev/null +++ b/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml @@ -0,0 +1,8 @@ +type: object +properties: + publisher: + description: "Name of publisher, distributor, etc." + type: string + dateOfPublication: + description: "Date (year YYYY) of publication, distribution, etc." + type: string \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/entity/seriesItem.yaml b/src/main/resources/swagger.api/schemas/dto/instance/seriesItem.yaml similarity index 89% rename from src/main/resources/swagger.api/schemas/entity/seriesItem.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/seriesItem.yaml index 12a039573..dfe53d631 100644 --- a/src/main/resources/swagger.api/schemas/entity/seriesItem.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/seriesItem.yaml @@ -1,5 +1,6 @@ type: object description: "A series item description" +additionalProperties: false properties: value: type: string diff --git a/src/main/resources/swagger.api/schemas/entity/subject.yaml b/src/main/resources/swagger.api/schemas/dto/instance/subject.yaml similarity index 89% rename from src/main/resources/swagger.api/schemas/entity/subject.yaml rename to src/main/resources/swagger.api/schemas/dto/instance/subject.yaml index 7581fc98a..ccac59c79 100644 --- a/src/main/resources/swagger.api/schemas/entity/subject.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/subject.yaml @@ -1,5 +1,6 @@ type: object description: "A subject heading description" +additionalProperties: false properties: value: type: string diff --git a/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml b/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml index c25d3b069..bf8fb6f7f 100644 --- a/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml +++ b/src/main/resources/swagger.api/schemas/entity/browseConfig.yaml @@ -1,10 +1,8 @@ type: object properties: id: - description: Option ID $ref: "browseOptionType.yaml" shelvingAlgorithm: - description: Defines shelving order algorithm $ref: "shelvingOrderAlgorithmType.yaml" typeIds: description: Type IDs that should be used by the option diff --git a/src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml b/src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml index a63735e56..11456a05a 100644 --- a/src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml +++ b/src/main/resources/swagger.api/schemas/entity/browseOptionType.yaml @@ -1,3 +1,4 @@ +description: Browse option type type: string enum: - all diff --git a/src/main/resources/swagger.api/schemas/entity/error.yaml b/src/main/resources/swagger.api/schemas/entity/error.yaml index af7f0a22e..39de4b869 100644 --- a/src/main/resources/swagger.api/schemas/entity/error.yaml +++ b/src/main/resources/swagger.api/schemas/entity/error.yaml @@ -11,6 +11,6 @@ properties: type: "string" description: "Error message code" parameters: - type: "object" - description: "Error message parameters" - $ref: "./parameters.yaml" + type: "array" + items: + $ref: "./parameter.yaml" diff --git a/src/main/resources/swagger.api/schemas/entity/facet.yaml b/src/main/resources/swagger.api/schemas/entity/facet.yaml index 89295aaa8..f2702dd19 100644 --- a/src/main/resources/swagger.api/schemas/entity/facet.yaml +++ b/src/main/resources/swagger.api/schemas/entity/facet.yaml @@ -2,8 +2,9 @@ description: "Result value for specific facet" type: "object" properties: values: - description: "Facet items" - $ref: "facetItems.yaml" + type: "array" + items: + $ref: "facetItem.yaml" totalRecords: type: "integer" description: "Amount of facet items" diff --git a/src/main/resources/swagger.api/schemas/entity/facetItems.yaml b/src/main/resources/swagger.api/schemas/entity/facetItems.yaml deleted file mode 100644 index 985b6b8d7..000000000 --- a/src/main/resources/swagger.api/schemas/entity/facetItems.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: "JSON schema for facet items" -type: "array" -items: - $ref: "facetItem.yaml" diff --git a/src/main/resources/swagger.api/schemas/entity/instance.yaml b/src/main/resources/swagger.api/schemas/entity/instance.yaml index 0975620eb..9b8827fb1 100644 --- a/src/main/resources/swagger.api/schemas/entity/instance.yaml +++ b/src/main/resources/swagger.api/schemas/entity/instance.yaml @@ -35,27 +35,27 @@ properties: description: "List of series titles associated with the resource (e.g. Harry Potter)" type: array items: - $ref: "seriesItem.yaml" + $ref: "../dto/instance/seriesItem.yaml" alternativeTitles: type: array description: "List of alternative titles for the resource (e.g. original language version title of a movie)" items: - $ref: "alternativeTitle.yaml" + $ref: "../dto/instance/alternativeTitle.yaml" identifiers: type: array description: "Resource identifier value array" items: - $ref: "identifiers.yaml" + $ref: "../dto/common/identifier.yaml" contributors: type: array description: "List of contributors names" items: - $ref: "contributor.yaml" + $ref: "../dto/instance/contributor.yaml" subjects: type: array description: "List of subject headings" items: - $ref: "subject.yaml" + $ref: "../dto/instance/subject.yaml" instanceTypeId: description: "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined" type: string @@ -70,7 +70,7 @@ properties: items: type: string metadata: - $ref: "metadata.yaml" + $ref: "../dto/common/metadata.yaml" administrativeNotes: type: array description: "Administrative notes" @@ -89,14 +89,7 @@ properties: description: "List of publication items" type: array items: - type: object - properties: - publisher: - description: "Name of publisher, distributor, etc." - type: string - dateOfPublication: - description: "Date (year YYYY) of publication, distribution, etc." - type: string + $ref: '../dto/instance/publication.yaml' staffSuppress: description: "Records the fact that the record should not be displayed for others than catalogers" type: boolean @@ -107,40 +100,32 @@ properties: description: "Indicates if this instance is included in a bound-with" type: boolean tags: - description: "arbitrary tags associated with this instance" - $ref: "tags.yaml" + $ref: "../dto/common/tags.yaml" classifications: type: array description: "List of classifications" items: - type: object - properties: - classificationNumber: - description: "Classification (e.g. classification scheme, classification schedule)" - type: string - classificationTypeId: - description: "Classification type ID" - type: string + $ref: '../dto/instance/classification.yaml' electronicAccess: description: "List of electronic access items" type: array items: - $ref: "electronicAccess.yaml" + $ref: "../dto/instance/electronicAccess.yaml" notes: description: "Bibliographic notes (e.g. general notes, specialized notes), and administrative notes" type: array items: - $ref: "note.yaml" + $ref: "../dto/instance/note.yaml" items: description: "List of instance items" type: array items: - $ref: "item.yaml" + $ref: "../dto/instance/item.yaml" holdings: description: "List of instance holding records" type: array items: - $ref: "holding.yaml" + $ref: "../dto/instance/holding.yaml" required: - electronicAccess - notes diff --git a/src/main/resources/swagger.api/schemas/entity/parameter.yaml b/src/main/resources/swagger.api/schemas/entity/parameter.yaml index 5b90b11f7..abcb0633c 100644 --- a/src/main/resources/swagger.api/schemas/entity/parameter.yaml +++ b/src/main/resources/swagger.api/schemas/entity/parameter.yaml @@ -7,3 +7,6 @@ properties: value: description: "Parameter value" type: "string" +example: + key: "source" + value: "null" \ No newline at end of file diff --git a/src/main/resources/swagger.api/schemas/entity/parameters.yaml b/src/main/resources/swagger.api/schemas/entity/parameters.yaml deleted file mode 100644 index a02ca63c3..000000000 --- a/src/main/resources/swagger.api/schemas/entity/parameters.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: "List of key/value parameters of an error" -type: "array" -items: - type: "object" - $ref: "./parameter.yaml" diff --git a/src/main/resources/swagger.api/schemas/entity/recordType.yaml b/src/main/resources/swagger.api/schemas/entity/recordType.yaml index e13b0afba..7f82fedc4 100644 --- a/src/main/resources/swagger.api/schemas/entity/recordType.yaml +++ b/src/main/resources/swagger.api/schemas/entity/recordType.yaml @@ -4,4 +4,4 @@ enum: - authorities - contributors - subjects - - classifications \ No newline at end of file + - classifications diff --git a/src/main/resources/swagger.api/schemas/entity/resouceIds.yaml b/src/main/resources/swagger.api/schemas/entity/resourceIds.yaml similarity index 100% rename from src/main/resources/swagger.api/schemas/entity/resouceIds.yaml rename to src/main/resources/swagger.api/schemas/entity/resourceIds.yaml diff --git a/src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml b/src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml index 2674598e0..ea57fb14c 100644 --- a/src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml +++ b/src/main/resources/swagger.api/schemas/entity/shelvingOrderAlgorithmType.yaml @@ -1,3 +1,4 @@ +description: Shelving order algorithm type: string enum: - lc diff --git a/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml b/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml deleted file mode 100644 index ea41b4569..000000000 --- a/src/main/resources/swagger.api/schemas/request/indexRecordRequest.yaml +++ /dev/null @@ -1,4 +0,0 @@ -type: array -items: - type: object - $ref: '../entity/resourceEvent.yaml' diff --git a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml b/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml index b14529ec2..300554ceb 100644 --- a/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml +++ b/src/main/resources/swagger.api/schemas/request/updateIndexDynamicSettingsRequest.yaml @@ -5,7 +5,6 @@ properties: type: string description: Resource name to set index Settings indexSettings: - description: Index settings to apply for index $ref: "../../schemas/entity/indexDynamicSettings.yaml" required: - resourceName diff --git a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml b/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml index f8d591147..2dedd20ec 100644 --- a/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml +++ b/src/main/resources/swagger.api/schemas/response/authorityBrowseItem.yaml @@ -1,9 +1,8 @@ -description: Call-number browse search result item +description: Authority browse result item type: object properties: authority: - description: Related authority object - $ref: '../../schemas/entity/authority.yaml' + $ref: '../../schemas/dto/authority/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/authoritySearchResult.yaml b/src/main/resources/swagger.api/schemas/response/authoritySearchResult.yaml index c01be8e9a..8bb3d26d5 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: "../../schemas/entity/authority.yaml" + $ref: "../../schemas/dto/authority/authority.yaml" diff --git a/src/main/resources/swagger.api/schemas/response/errorResponse.yaml b/src/main/resources/swagger.api/schemas/response/errorResponse.yaml index d33b1ec9f..83184eafb 100644 --- a/src/main/resources/swagger.api/schemas/response/errorResponse.yaml +++ b/src/main/resources/swagger.api/schemas/response/errorResponse.yaml @@ -3,11 +3,16 @@ type: "object" properties: errors: description: "List of errors" - id: "errors" type: "array" items: - type: "object" $ref: "../entity/error.yaml" total_records: description: "Total number of errors" type: "integer" +example: + errors: + - message: "Illegal argument error" + type: "IllegalArgumentException" + code: "unknown_error" + total_records: 1 + diff --git a/src/test/java/org/folio/search/controller/BrowseClassificationConsortiumIT.java b/src/test/java/org/folio/search/controller/BrowseClassificationConsortiumIT.java index 7c4248a33..448cb7ace 100644 --- a/src/test/java/org/folio/search/controller/BrowseClassificationConsortiumIT.java +++ b/src/test/java/org/folio/search/controller/BrowseClassificationConsortiumIT.java @@ -31,11 +31,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.folio.search.domain.dto.BrowseOptionType; +import org.folio.search.domain.dto.Classification; import org.folio.search.domain.dto.ClassificationNumberBrowseResult; 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.InstanceClassificationsInner; import org.folio.search.domain.dto.RecordType; import org.folio.search.model.Pair; import org.folio.search.support.base.BaseConsortiumIntegrationTest; @@ -161,7 +161,7 @@ private static Instance instance(List data) { .id(randomId()) .title((String) data.get(0)) .classifications(((List>) data.get(1)).stream() - .map(pair -> new InstanceClassificationsInner() + .map(pair -> new Classification() .classificationNumber(String.valueOf(pair.getFirst())) .classificationTypeId(String.valueOf(pair.getSecond()))) .collect(Collectors.toList())) diff --git a/src/test/java/org/folio/search/controller/BrowseClassificationIT.java b/src/test/java/org/folio/search/controller/BrowseClassificationIT.java index a180409cd..9fc8add1b 100644 --- a/src/test/java/org/folio/search/controller/BrowseClassificationIT.java +++ b/src/test/java/org/folio/search/controller/BrowseClassificationIT.java @@ -24,9 +24,9 @@ import org.folio.search.domain.dto.BrowseConfig; import org.folio.search.domain.dto.BrowseOptionType; import org.folio.search.domain.dto.BrowseType; +import org.folio.search.domain.dto.Classification; import org.folio.search.domain.dto.ClassificationNumberBrowseResult; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceClassificationsInner; import org.folio.search.domain.dto.ShelvingOrderAlgorithmType; import org.folio.search.model.Pair; import org.folio.search.support.base.BaseIntegrationTest; @@ -212,7 +212,7 @@ private static Instance instance(List data) { .id(randomId()) .title((String) data.get(0)) .classifications(((List>) data.get(1)).stream() - .map(pair -> new InstanceClassificationsInner() + .map(pair -> new Classification() .classificationNumber(String.valueOf(pair.getFirst())) .classificationTypeId(String.valueOf(pair.getSecond()))) .collect(Collectors.toList())) diff --git a/src/test/java/org/folio/search/controller/IndexingInstanceClassificationIT.java b/src/test/java/org/folio/search/controller/IndexingInstanceClassificationIT.java index 03a64ebbe..b3a8fde22 100644 --- a/src/test/java/org/folio/search/controller/IndexingInstanceClassificationIT.java +++ b/src/test/java/org/folio/search/controller/IndexingInstanceClassificationIT.java @@ -19,8 +19,8 @@ import lombok.SneakyThrows; import org.awaitility.Awaitility; import org.awaitility.core.ThrowingRunnable; +import org.folio.search.domain.dto.Classification; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceClassificationsInner; import org.folio.search.model.client.CqlQueryParam; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.SearchUtils; @@ -57,7 +57,7 @@ void shouldIndexInstanceClassification_createNewDocument() { var instanceId2 = randomId(); var lcTypeId = "ce176ace-a53e-4b4d-aa89-725ed7b2edac"; var number = "N123"; - var classification = new InstanceClassificationsInner().classificationNumber(number).classificationTypeId(lcTypeId); + var classification = new Classification().classificationNumber(number).classificationTypeId(lcTypeId); var instance1 = new Instance().id(instanceId1).addClassificationsItem(classification); var instance2 = new Instance().id(instanceId2).addClassificationsItem(classification); inventoryApi.createInstance(TENANT_ID, instance1); @@ -88,7 +88,7 @@ void shouldIndexInstanceClassification_createNewDocument() { @Test void shouldIndexInstanceClassification_deleteDocument() { var instanceId = randomId(); - var classification = new InstanceClassificationsInner().classificationNumber("N123").classificationTypeId("type1"); + var classification = new Classification().classificationNumber("N123").classificationTypeId("type1"); var instance = new Instance().id(instanceId).addClassificationsItem(classification); inventoryApi.createInstance(TENANT_ID, instance); assertCountByIds(instanceSearchPath(), List.of(instanceId), 1); diff --git a/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java b/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java index 435c3d95d..4baa4c32a 100644 --- a/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java +++ b/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java @@ -24,7 +24,7 @@ import org.apache.lucene.search.TotalHits.Relation; import org.folio.search.domain.dto.AlternativeTitle; import org.folio.search.domain.dto.Contributor; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Metadata; import org.folio.search.domain.dto.SeriesItem; @@ -99,8 +99,8 @@ private static Instance instance(Consumer setters) { return instance; } - private static Identifiers identifier(String value) { - var identifier = new Identifiers(); + private static Identifier identifier(String value) { + var identifier = new Identifier(); identifier.setValue(value); return identifier; } diff --git a/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java b/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java index 612394815..86383bac4 100644 --- a/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java +++ b/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Optional; import org.folio.search.domain.dto.Authority; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.ResourceEvent; import org.folio.search.model.metadata.AuthorityFieldDescription; import org.folio.search.model.metadata.FieldDescription; @@ -104,7 +104,7 @@ void process_positive_reindexEvent() { @Test void process_positive_onlyCommonFieldsArePopulated() { var authority = new Authority().id(RESOURCE_ID).subjectHeadings("a subject headings") - .identifiers(List.of(new Identifiers().value("an authority identifier"))); + .identifiers(List.of(new Identifier().value("an authority identifier"))); var actual = eventPreProcessor.preProcess(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); assertThat(actual).isEqualTo(List.of(event("other0", expectedAuthorityAsMap(authority)))); } @@ -172,7 +172,7 @@ private static Authority fullAuthorityRecord() { .sftUniformTitle(List.of("a sft uniform title")) .saftUniformTitle(List.of("a saft uniform title")) .subjectHeadings("a subject heading") - .identifiers(List.of(new Identifiers() + .identifiers(List.of(new Identifier() .value("an identifier value") .identifierTypeId("an identifier type id"))); } diff --git a/src/test/java/org/folio/search/service/setter/authority/LccnAuthorityProcessorTest.java b/src/test/java/org/folio/search/service/setter/authority/LccnAuthorityProcessorTest.java index f8712a106..79ce3f93d 100644 --- a/src/test/java/org/folio/search/service/setter/authority/LccnAuthorityProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/authority/LccnAuthorityProcessorTest.java @@ -13,7 +13,7 @@ import java.util.stream.Stream; import org.apache.commons.collections.CollectionUtils; import org.folio.search.domain.dto.Authority; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; import org.folio.spring.testing.type.UnitTest; @@ -71,7 +71,7 @@ private static Stream lccnDataProvider() { ); } - private static Identifiers lccn(String value) { + private static Identifier lccn(String value) { return identifier(LCCN_IDENTIFIER_TYPE_ID, value); } diff --git a/src/test/java/org/folio/search/service/setter/instance/ClassificationNumberProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/ClassificationNumberProcessorTest.java index 05b63fb45..a73a04be0 100644 --- a/src/test/java/org/folio/search/service/setter/instance/ClassificationNumberProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/ClassificationNumberProcessorTest.java @@ -5,8 +5,8 @@ import java.util.Collections; import java.util.Set; +import org.folio.search.domain.dto.Classification; import org.folio.search.domain.dto.Instance; -import org.folio.search.domain.dto.InstanceClassificationsInner; import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,13 +16,13 @@ class ClassificationNumberProcessorTest { private ClassificationNumberProcessor processor; private Instance instance; - private InstanceClassificationsInner classification; + private Classification classification; @BeforeEach void setUp() { processor = new ClassificationNumberProcessor(); instance = new Instance(); - classification = new InstanceClassificationsInner(); + classification = new Classification(); } @Test diff --git a/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java index f3748173b..15f40d389 100644 --- a/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java @@ -16,7 +16,7 @@ import java.util.List; import org.folio.search.domain.dto.Holding; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.Note; @@ -72,8 +72,8 @@ void getFieldValue_positive_multilangSubjects() { @Test void getFieldValue_positive_identifiers() { var actual = processor.getFieldValue(toMap(new Instance().identifiers(List.of( - new Identifiers().identifierTypeId(randomId()).value("978-1-56619-909-4"), - new Identifiers().identifierTypeId(randomId()).value("1-56619-909-3"))))); + new Identifier().identifierTypeId(randomId()).value("978-1-56619-909-4"), + new Identifier().identifierTypeId(randomId()).value("1-56619-909-3"))))); assertThat(actual).isEqualTo(MultilangValue.of( newLinkedHashSet("978-1-56619-909-4", "1-56619-909-3"), emptySet())); verify(searchFieldProvider, times(2)).isFullTextField(INSTANCE_RESOURCE, "identifiers.value"); diff --git a/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java index f30735621..25d427c66 100644 --- a/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java @@ -16,7 +16,7 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.commons.collections.CollectionUtils; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; @@ -112,11 +112,11 @@ private static Stream isbnDataProvider() { ); } - private static Identifiers isbn(String value) { + private static Identifier isbn(String value) { return identifier(ISBN_IDENTIFIER_TYPE_ID, value); } - private static Identifiers invalidIsbn(String value) { + private static Identifier invalidIsbn(String value) { return identifier(INVALID_ISBN_IDENTIFIER_TYPE_ID, value); } diff --git a/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java index 03f99c461..17fcfc7b3 100644 --- a/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java @@ -17,7 +17,7 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.commons.collections.CollectionUtils; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; @@ -87,15 +87,15 @@ private static Stream issnDataProvider() { ); } - private static Identifiers issn(String value) { + private static Identifier issn(String value) { return identifier(ISSN_IDENTIFIER_TYPE_ID, value); } - private static Identifiers invalidIssn(String value) { + private static Identifier invalidIssn(String value) { return identifier(INVALID_ISSN_IDENTIFIER_TYPE_ID, value); } - private static Identifiers linkingIssn(String value) { + private static Identifier linkingIssn(String value) { return identifier(LINKING_ISSN_IDENTIFIER_TYPE_ID, value); } diff --git a/src/test/java/org/folio/search/service/setter/instance/LccnInstanceProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/LccnInstanceProcessorTest.java index 4518666a3..d0a25a8e3 100644 --- a/src/test/java/org/folio/search/service/setter/instance/LccnInstanceProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/LccnInstanceProcessorTest.java @@ -12,7 +12,7 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.commons.collections.CollectionUtils; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; @@ -72,7 +72,7 @@ private static Stream lccnDataProvider() { ); } - private static Identifiers lccn(String value) { + private static Identifier lccn(String value) { return identifier(LCCN_IDENTIFIER_TYPE_ID, value); } diff --git a/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java index 285ae8562..9fb6c6f40 100644 --- a/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java @@ -16,7 +16,7 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.commons.collections.CollectionUtils; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; @@ -81,11 +81,11 @@ private static Stream oclcDataProvider() { ); } - private static Identifiers oclc(String value) { + private static Identifier oclc(String value) { return identifier(OCLC_IDENTIFIER_TYPE_ID, value); } - private static Identifiers canceledOclc(String value) { + private static Identifier canceledOclc(String value) { return identifier(CANCELED_OCLC_IDENTIFIER_TYPE_ID, value); } diff --git a/src/test/java/org/folio/search/utils/TestUtils.java b/src/test/java/org/folio/search/utils/TestUtils.java index 90278bea0..fcb82fa6e 100644 --- a/src/test/java/org/folio/search/utils/TestUtils.java +++ b/src/test/java/org/folio/search/utils/TestUtils.java @@ -73,7 +73,7 @@ import org.folio.search.domain.dto.Facet; import org.folio.search.domain.dto.FacetItem; import org.folio.search.domain.dto.FacetResult; -import org.folio.search.domain.dto.Identifiers; +import org.folio.search.domain.dto.Identifier; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.InstanceContributorBrowseItem; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; @@ -565,15 +565,15 @@ public static Tags tags(String... tagValues) { return new Tags().tagList(tagValues != null ? asList(tagValues) : null); } - public static Identifiers identifier(String id, String value) { - return new Identifiers().identifierTypeId(id).value(value); + public static Identifier identifier(String id, String value) { + return new Identifier().identifierTypeId(id).value(value); } - public static Instance instanceWithIdentifiers(Identifiers... identifiers) { + public static Instance instanceWithIdentifiers(Identifier... identifiers) { return new Instance().id(RESOURCE_ID).identifiers(identifiers != null ? asList(identifiers) : null); } - public static Authority authorityWithIdentifiers(Identifiers... identifiers) { + public static Authority authorityWithIdentifiers(Identifier... identifiers) { return new Authority().identifiers(identifiers != null ? asList(identifiers) : null); }