Skip to content

Commit 433ac5b

Browse files
authored
Fix interfaces for IML APIs. (#469) (#470)
Fixing the bugs with wrong generated interfaces. Relates-To: OLPEDGE-2572 Signed-off-by: Oleksii Zubko <[email protected]>
1 parent cb9aa4c commit 433ac5b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

@here/olp-sdk-dataservice-api/lib/interactive-api-v1.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface Feature extends GeoJSON {
4747
id?: string;
4848
geometry?: GeoJSON;
4949
properties?: { [key: string]: any };
50+
features?: Array<Feature>;
5051
}
5152

5253
export interface FeatureCollection extends GeoJSON {
@@ -982,7 +983,7 @@ export async function searchFeatures(
982983
export async function deleteFeature(
983984
builder: RequestBuilder,
984985
params: { layerId: string; featureId: string }
985-
): Promise<Feature> {
986+
): Promise<Response> {
986987
const baseUrl = "/layers/{layerId}/features/{featureId}"
987988
.replace("{layerId}", UrlBuilder.toString(params["layerId"]))
988989
.replace("{featureId}", UrlBuilder.toString(params["featureId"]));
@@ -995,7 +996,7 @@ export async function deleteFeature(
995996
headers
996997
};
997998

998-
return builder.request<Feature>(urlBuilder, options);
999+
return builder.requestBlob(urlBuilder, options);
9991000
}
10001001

10011002
/**
@@ -1015,7 +1016,7 @@ export async function deleteFeature(
10151016
export async function deleteFeatures(
10161017
builder: RequestBuilder,
10171018
params: { layerId: string; id?: Array<string> }
1018-
): Promise<FeatureCollectionModification> {
1019+
): Promise<Response> {
10191020
const baseUrl = "/layers/{layerId}/features".replace(
10201021
"{layerId}",
10211022
UrlBuilder.toString(params["layerId"])
@@ -1030,7 +1031,7 @@ export async function deleteFeatures(
10301031
headers
10311032
};
10321033

1033-
return builder.request<FeatureCollectionModification>(urlBuilder, options);
1034+
return builder.requestBlob(urlBuilder, options);
10341035
}
10351036

10361037
/**

@here/olp-sdk-dataservice-api/test/InteractiveV1Api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ describe("InteractiveApi", function() {
295295
it("deleteFeature", async function() {
296296
const builder = {
297297
baseUrl: "http://mocked.url",
298-
request: async (urlBuilder: any, options: any) => {
298+
requestBlob: async (urlBuilder: any, options: any) => {
299299
expect(urlBuilder.url).to.be.equals(
300300
`http://mocked.url/layers/mocked-layerId/features/mocked-featureId`
301301
);
@@ -315,7 +315,7 @@ describe("InteractiveApi", function() {
315315
it("deleteFeatures", async function() {
316316
const builder = {
317317
baseUrl: "http://mocked.url",
318-
request: async (urlBuilder: any, options: any) => {
318+
requestBlob: async (urlBuilder: any, options: any) => {
319319
expect(urlBuilder.url).to.be.equals(
320320
`http://mocked.url/layers/mocked-layerId/features?id=mocked-featureId,mocked-featureId-2`
321321
);

0 commit comments

Comments
 (0)