diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java index f530c842ba0bae004bc3e54e080cca143edb88c9..163664f5f04b0c7ee0b03f4fb4113eddee038235 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java @@ -24,7 +24,7 @@ public class SchemaConverterPropertiesConfig implements SchemaConverterConfig { } private Set<String> getDefaultSupportedArrayTypes() { - return new HashSet<>(Arrays.asList("boolean", "integer", "number", "string")); + return new HashSet<>(Arrays.asList("boolean", "integer", "number", "string", "object")); } private Map<String, String> getDefaultSpecialDefinitionsMap() { diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res index b0f71fc6fd26e27eb5dc2362e7667aa1d17c481e..d0cc00a8d3fe76d6ff446a8433c4b895e8a88316 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res @@ -40,6 +40,10 @@ { "kind": "string", "path": "Checksum" + }, + { + "kind": "[]object", + "path": "VectorHeaderMapping" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res index 136ed0b7ecb61b50f82b8d8e213db03ab410f8da..8728c3bc5da175c23046b1f86381ef5eb99cbfe3 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res @@ -32,6 +32,14 @@ { "kind": "[]link", "path": "Counterparties" + }, + { + "kind": "[]object", + "path": "Terms" + }, + { + "kind": "[]object", + "path": "RestrictedResources" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res index 517ca0395223bf432f8bc6b8c01bf7c768921532..359986f472e4ea54a08e6496b5230b914c3a80f0 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res @@ -76,6 +76,10 @@ { "kind": "string", "path": "VerticalMeasurementID" + }, + { + "kind": "[]object", + "path": "Curves" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res index 0b807093bb76e1b01fa2c4d2753864bab6f52386..5852817c878ac55fcc522b6752635389135b40ae 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res @@ -44,6 +44,10 @@ { "kind": "[]string", "path": "Annotations" + }, + { + "kind": "[]object", + "path": "LineageAssertions" } ] } \ No newline at end of file diff --git a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java index 0e8293b1a59abd37ebdcd59bf3f2610a7c39e813..ebfe87ef077c4bbb244a1b68ba94d9138bfc0753 100644 --- a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java +++ b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java @@ -23,12 +23,36 @@ public class AppExceptionHandler { ? e.getOriginalException().getMessage() : e.getError().getMessage(); - if (e.getError().getCode() > 499) { + Integer errorCode = e.getError().getCode(); + + if (errorCode > 499) { log.error(exceptionMsg, e.getOriginalException()); } else { log.warn(exceptionMsg, e.getOriginalException()); } - return new ResponseEntity<>(e.getError(), HttpStatus.resolve(e.getError().getCode())); + HttpStatus status = Objects.nonNull(HttpStatus.resolve(errorCode)) + ? HttpStatus.resolve(errorCode) + : resolveNotSupportedStatus(errorCode); + + return new ResponseEntity<>(e.getError(), status); + } + + //Currently not all codes provided from core can be resolved by HttpStatus + //example org.opengroup.osdu.core.common.model.http.RequestStatus have not supported by HttpStatus codes + private HttpStatus resolveNotSupportedStatus(int statusCode) { + if (statusCode > 99 && statusCode < 200) { + return HttpStatus.CONTINUE; + } + if (statusCode > 199 && statusCode < 300) { + return HttpStatus.NO_CONTENT; + } + if (statusCode > 299 && statusCode < 400) { + return HttpStatus.MULTIPLE_CHOICES; + } + if (statusCode > 399 && statusCode < 500) { + return HttpStatus.BAD_REQUEST; + } + return HttpStatus.INTERNAL_SERVER_ERROR; } } diff --git a/provider/indexer-gcp/src/main/resources/application.properties b/provider/indexer-gcp/src/main/resources/application.properties index 08ee586c371bc8fecc4e21227ef2b4f1c8b76c5e..2213e4dca947f3ad90a5998299005c613a47ef61 100644 --- a/provider/indexer-gcp/src/main/resources/application.properties +++ b/provider/indexer-gcp/src/main/resources/application.properties @@ -42,5 +42,3 @@ security.https.certificate.trust=false indexer.que.service.mail=default@iam.gserviceaccount.com SCHEMA_HOST=${HOST}/api/schema-service/v1/schema storage-query-kinds-host=https://${STORAGE_HOSTNAME}/api/storage/v2/query/kinds - -schema.converter.supported-array-types=boolean,integer,number,string,object