From 213ce157cb088e7156f7ad0f7745cadf12af82d9 Mon Sep 17 00:00:00 2001 From: Niv Greenstein Date: Sat, 19 Oct 2024 11:05:52 +0300 Subject: [PATCH 1/3] fix(openapi): created geo_context_mode schema and reference it correctly --- openapi3.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openapi3.yaml b/openapi3.yaml index 882d0fdb..f642d1b1 100644 --- a/openapi3.yaml +++ b/openapi3.yaml @@ -538,9 +538,7 @@ components: in: 'query' description: 'Choose whether geo_context query parameter will be a filter or a bias value' schema: - type: string - enum: ['filter', 'bias'] - + $ref: '#/components/schemas/geo_context_mode' schemas: errorSchema: type: 'object' @@ -764,7 +762,7 @@ components: geo_context: $ref: '#/components/schemas/geo_context' geo_context_mode: - $ref: '#/components/parameters/geo_context_mode' + $ref: '#/components/schemas/geo_context_mode' disable_fuzziness: $ref: '#/components/schemas/disable_fuzziness' response: @@ -1019,6 +1017,9 @@ components: $ref: '#/components/schemas/BoundingBox' - $ref: '#/components/schemas/WGS84Circle' - $ref: '#/components/schemas/UTMCircle' + geo_context_mode: + type: string + enum: ['filter', 'bias'] disable_fuzziness: type: boolean default: false From f5ff371b3b0fc111cbac7fc25e0c2ad1527f1301 Mon Sep 17 00:00:00 2001 From: Niv Greenstein Date: Sat, 19 Oct 2024 11:06:26 +0300 Subject: [PATCH 2/3] fix(openapi): changed double quotes to single quotes --- openapi3.yaml | 158 +++++++++++++++++++++++++------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/openapi3.yaml b/openapi3.yaml index f642d1b1..15fecabb 100644 --- a/openapi3.yaml +++ b/openapi3.yaml @@ -112,32 +112,32 @@ paths: application/json: schema: allOf: - - "$ref": "#/components/schemas/genericGeocodingResponse" - - type: "object" + - '$ref': '#/components/schemas/genericGeocodingResponse' + - type: 'object' required: - - "type" - - "features" + - 'type' + - 'features' properties: type: - type: "string" + type: 'string' enum: - - "FeatureCollection" + - 'FeatureCollection' features: - type: "array" + type: 'array' items: - type: "object" + type: 'object' properties: geometry: oneOf: - - $ref: "#/components/schemas/Point" - - $ref: "#/components/schemas/Polygon" + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/Polygon' properties: - type: "object" + type: 'object' properties: placetype: - type: "string" + type: 'string' sub_placetype: - type: "string" + type: 'string' 400: '$ref': '#/components/responses/BadRequest' 401: @@ -423,21 +423,21 @@ paths: type: object properties: type: - type: "string" + type: 'string' enum: - - "Feature" + - 'Feature' geocoding: - type: "object" + type: 'object' properties: query: - type: "object" + type: 'object' properties: lat: type: number lon: type: number response: - type: "object" + type: 'object' properties: max_score: type: number @@ -446,11 +446,11 @@ paths: match_latency_ms: type: number bbox: - $ref: "#/components/schemas/BoundingBox" + $ref: '#/components/schemas/BoundingBox' geometry: oneOf: - - $ref: "#/components/schemas/Point" - - $ref: "#/components/schemas/Polygon" + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/Polygon' properties: type: object properties: @@ -598,20 +598,20 @@ components: type: 'object' properties: type: - type: "string" + type: 'string' enum: - - "Feature" + - 'Feature' geocoding: - type: "object" + type: 'object' properties: query: - type: "object" + type: 'object' properties: tile: type: string - example: "18SUJ2339007393" + example: '18SUJ2339007393' response: - type: "object" + type: 'object' properties: max_score: type: number @@ -621,11 +621,11 @@ components: type: number bbox: - $ref: "#/components/schemas/BoundingBox" + $ref: '#/components/schemas/BoundingBox' geometry: oneOf: - - $ref: "#/components/schemas/Point" - - $ref: "#/components/schemas/Polygon" + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/Polygon' properties: type: object properties: @@ -633,98 +633,98 @@ components: type: number tilesSchema: allOf: - - $ref: "#/components/schemas/genericGeocodingResponse" - - type: "object" - description: "GeoJson feature collection representing a tile (Polygon)" + - $ref: '#/components/schemas/genericGeocodingResponse' + - type: 'object' + description: 'GeoJson feature collection representing a tile (Polygon)' required: - - "type" - - "features" + - 'type' + - 'features' properties: type: - type: "string" + type: 'string' enum: - - "FeatureCollection" + - 'FeatureCollection' features: - type: "array" + type: 'array' items: - $ref: "#/components/schemas/tileSchema" + $ref: '#/components/schemas/tileSchema' itemsSchema: allOf: - - $ref: "#/components/schemas/genericGeocodingResponse" - - type: "object" - description: "GeoJson feature collection representing an item" + - $ref: '#/components/schemas/genericGeocodingResponse' + - type: 'object' + description: 'GeoJson feature collection representing an item' required: - - "type" - - "features" + - 'type' + - 'features' properties: type: - type: "string" + type: 'string' enum: - - "FeatureCollection" + - 'FeatureCollection' features: - type: "array" + type: 'array' items: - type: "object" + type: 'object' properties: geometry: oneOf: - - $ref: "#/components/schemas/Point" - - $ref: "#/components/schemas/Polygon" + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/Polygon' properties: - type: "object" + type: 'object' required: - - "TYPE" - - "object_command_name" - - "entity_heb" - - "sub_tile_id" + - 'TYPE' + - 'object_command_name' + - 'entity_heb' + - 'sub_tile_id' properties: TYPE: - type: "string" + type: 'string' object_command_name: - type: "string" + type: 'string' entity_heb: - type: "string" + type: 'string' tile_name: - type: "string" + type: 'string' sub_tile_id: - type: "string" + type: 'string' routesSchema: allOf: - - $ref: "#/components/schemas/genericGeocodingResponse" - - type: "object" - description: "GeoJson feature collection representing a route (MultiLineString, LineString)" + - $ref: '#/components/schemas/genericGeocodingResponse' + - type: 'object' + description: 'GeoJson feature collection representing a route (MultiLineString, LineString)' required: - - "type" - - "features" + - 'type' + - 'features' properties: type: - type: "string" + type: 'string' enum: - - "FeatureCollection" + - 'FeatureCollection' features: - type: "array" + type: 'array' items: - type: "object" + type: 'object' properties: geometry: oneOf: - - $ref: "#/components/schemas/LineString" - - $ref: "#/components/schemas/MultiLineString" + - $ref: '#/components/schemas/LineString' + - $ref: '#/components/schemas/MultiLineString' properties: - type: "object" + type: 'object' required: - - "TYPE" - - "object_command_name" - - "entity_heb" + - 'TYPE' + - 'object_command_name' + - 'entity_heb' properties: TYPE: - type: "string" + type: 'string' object_command_name: - type: "string" + type: 'string' entity_heb: - type: "string" + type: 'string' SECTION: - type: "string" + type: 'string' genericGeocodingResponse: # we need discriminator for Control and Location type: 'object' description: 'GeoJson feature collection representing an item' From a2d9da1c1f1958c19ae67d7f24767d4d9e2de67e Mon Sep 17 00:00:00 2001 From: Niv Greenstein Date: Sat, 19 Oct 2024 11:28:34 +0300 Subject: [PATCH 3/3] fix: added missing configuration property --- config/default.json | 1 + config/test.json | 1 + 2 files changed, 2 insertions(+) diff --git a/config/default.json b/config/default.json index 9c165b10..a1f2d8a8 100644 --- a/config/default.json +++ b/config/default.json @@ -85,6 +85,7 @@ } }, "application": { + "site": "local", "services": { "tokenTypesUrl": "http://NLP_ANALYSES" }, diff --git a/config/test.json b/config/test.json index 8305cd32..40fdcdb8 100644 --- a/config/test.json +++ b/config/test.json @@ -59,6 +59,7 @@ } }, "application": { + "site": "test", "services": { "tokenTypesUrl": "http://localhost:5001/NLP_ANALYSES" },