Skip to content
Snippets Groups Projects
Commit ebeb1a59 authored by Dmitriy Rudko's avatar Dmitriy Rudko :speech_balloon:
Browse files

#16 - Fix indexing ' array of object' for all CSPs

parent e145394e
No related branches found
No related tags found
1 merge request!123#16 - Fix indexing ' array of object' for all CSPs
...@@ -24,7 +24,7 @@ public class SchemaConverterPropertiesConfig implements SchemaConverterConfig { ...@@ -24,7 +24,7 @@ public class SchemaConverterPropertiesConfig implements SchemaConverterConfig {
} }
private Set<String> getDefaultSupportedArrayTypes() { 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() { private Map<String, String> getDefaultSpecialDefinitionsMap() {
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
{ {
"kind": "string", "kind": "string",
"path": "Checksum" "path": "Checksum"
},
{
"kind": "[]object",
"path": "VectorHeaderMapping"
} }
] ]
} }
\ No newline at end of file
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
{ {
"kind": "[]link", "kind": "[]link",
"path": "Counterparties" "path": "Counterparties"
},
{
"kind": "[]object",
"path": "Terms"
},
{
"kind": "[]object",
"path": "RestrictedResources"
} }
] ]
} }
\ No newline at end of file
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
{ {
"kind": "string", "kind": "string",
"path": "VerticalMeasurementID" "path": "VerticalMeasurementID"
},
{
"kind": "[]object",
"path": "Curves"
} }
] ]
} }
\ No newline at end of file
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
{ {
"kind": "[]string", "kind": "[]string",
"path": "Annotations" "path": "Annotations"
},
{
"kind": "[]object",
"path": "LineageAssertions"
} }
] ]
} }
\ No newline at end of file
...@@ -23,12 +23,36 @@ public class AppExceptionHandler { ...@@ -23,12 +23,36 @@ public class AppExceptionHandler {
? e.getOriginalException().getMessage() ? e.getOriginalException().getMessage()
: e.getError().getMessage(); : e.getError().getMessage();
if (e.getError().getCode() > 499) { Integer errorCode = e.getError().getCode();
if (errorCode > 499) {
log.error(exceptionMsg, e.getOriginalException()); log.error(exceptionMsg, e.getOriginalException());
} else { } else {
log.warn(exceptionMsg, e.getOriginalException()); 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;
} }
} }
...@@ -42,5 +42,3 @@ security.https.certificate.trust=false ...@@ -42,5 +42,3 @@ security.https.certificate.trust=false
indexer.que.service.mail=default@iam.gserviceaccount.com indexer.que.service.mail=default@iam.gserviceaccount.com
SCHEMA_HOST=${HOST}/api/schema-service/v1/schema SCHEMA_HOST=${HOST}/api/schema-service/v1/schema
storage-query-kinds-host=https://${STORAGE_HOSTNAME}/api/storage/v2/query/kinds storage-query-kinds-host=https://${STORAGE_HOSTNAME}/api/storage/v2/query/kinds
schema.converter.supported-array-types=boolean,integer,number,string,object
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment