Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions openapi3.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid adding new field via raster-catalog-manager as we want it all be taken from mc-models as it now.
add the keywords field to fullLayerMetadata as an optional field

Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,13 @@ components:
description: raster catalog find model
properties:
metadata:
$ref: >-
./Schema/fullLayerMetadata.yaml#/components/schemas/fullLayerMetadata
allOf:
- $ref: >-
./Schema/fullLayerMetadata.yaml#/components/schemas/fullLayerMetadata
- properties:
keywords:
type: string
description: Product's keywords
links:
type: array
items:
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/DAL/recordModelConverter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,32 @@
});
});

describe('entityToModel - keywords', () => {
it('converted model includes keywords when entity has keywords value', () => {
const entity = {
sensors: '',
region: null,
keywords: 'satellite,aerial',
} as unknown as RecordEntity;

const model = convertor.entityToModel(entity);

expect(model.metadata?.keywords).toBe('satellite,aerial');

Check failure on line 328 in tests/unit/DAL/recordModelConverter.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests (24.x)

Property 'keywords' does not exist on type 'LayerMetadata'.
});

it('converted model omits keywords when entity keywords is null', () => {
const entity = {
sensors: '',
region: null,
keywords: null,
} as unknown as RecordEntity;

const model = convertor.entityToModel(entity);

expect(model.metadata?.keywords).toBeUndefined();

Check failure on line 340 in tests/unit/DAL/recordModelConverter.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests (24.x)

Property 'keywords' does not exist on type 'LayerMetadata'.
});
});

describe('findModelToEntity', () => {
it('find should return the given attribute', () => {
const testUpdateRecordRequest = {
Expand Down
Loading