Commit b00ddcea authored by Diego Molteni's avatar Diego Molteni
Browse files

fixed kind check and recordType set

parent 007cdf81
Pipeline #31848 passed with stages
in 5 minutes and 34 seconds
......@@ -534,8 +534,14 @@ export class DatasetHandler {
// mandatory field required if a new seismic metadata record is ingested (kind/data required)
Params.checkString(seismicmeta.kind, 'kind');
Params.checkObject(seismicmeta.data, 'data');
seismicmeta.recordType =
seismicmeta.recordType ? ':' + seismicmeta.recordType + ':' : ':seismic3d:';
// {data-parititon(delfi)|auhtority(osdu)}.{source}.{entityType}.{semanticSchemaVersion}
if((seismicmeta.kind as string).split(':').length !== 4) {
throw (Error.make(Error.Status.BAD_REQUEST, 'The seismicmeta kind is in a wrong format'));
}
// (recortdType == entityType)
seismicmeta.recordType = ':' + (seismicmeta.kind as string).split(':')[2] + ':';
// if id is given, take it. otherwise generate
if (!seismicmeta.id) {
......
......@@ -62,7 +62,14 @@ export class DatasetParser {
if (seismicmeta) {
Params.checkString(seismicmeta.kind, 'kind'); // mandatory string
Params.checkObject(seismicmeta.data, 'data');
seismicmeta.recordType = seismicmeta.recordType ? ':' + seismicmeta.recordType + ':' : ':seismic3d:';
// {data-parititon(delfi)|auhtority(osdu)}.{source}.{entityType}.{semanticSchemaVersion}
if((seismicmeta.kind as string).split(':').length !== 4) {
throw (Error.make(Error.Status.BAD_REQUEST, 'The seismicmeta kind is in a wrong format'));
}
// (recortdType == entityType)
seismicmeta.recordType = ':' + (seismicmeta.kind as string).split(':')[2] + ':';
}
return [dataset, seismicmeta];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment