From 2f5bdcdb09473beb98c038e9698aa5065d5eb76b Mon Sep 17 00:00:00 2001 From: Evan Wies Date: Fri, 1 Mar 2024 06:37:56 -0500 Subject: [PATCH 1/2] Fix incorrect fields (#8) * `latitude` in POI is `number`, not `integer` * `UserComments` IDs are `integer`, not `string` * `MediaItem` IDs are `integer`, not `string` --- Model/schema/ocm-openapi-spec.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Model/schema/ocm-openapi-spec.yaml b/Model/schema/ocm-openapi-spec.yaml index 33f58d0..d4be0b1 100644 --- a/Model/schema/ocm-openapi-spec.yaml +++ b/Model/schema/ocm-openapi-spec.yaml @@ -51,7 +51,7 @@ paths: name: countryid description: Exact match on a given numeric country id (comma separated list) - schema: - type: integer + type: number in: query name: latitude description: Latitude for distance calculation and filtering @@ -572,7 +572,7 @@ components: ID: 148527 UUID: 4C524AA1-3413-4D56-804C-480304FEB0FB UserComments: - - ID: string + - ID: 0 ChargePointID: 0 CommentTypeID: 0 CommentType: {} @@ -589,8 +589,8 @@ components: CheckinStatusType: {} '': string MediaItems: - - ID: string - ChargePointID: string + - ID: int + ChargePointID: int ItemURL: string ItemThumbnailURL: string Comment: string @@ -1053,7 +1053,7 @@ components: description: A user comment or check-in for a specific charging point (POI/Site) properties: ID: - type: string + type: integer ChargePointID: type: integer CommentTypeID: @@ -1080,9 +1080,9 @@ components: description: A user submitted media item related to a specific charge point or site. Currently always an image. properties: ID: - type: string + type: integer ChargePointID: - type: string + type: integer ItemURL: type: string ItemThumbnailURL: @@ -1751,7 +1751,7 @@ components: - ID: 148527 UUID: 4C524AA1-3413-4D56-804C-480304FEB0FB UserComments: - - ID: string + - ID: 0 ChargePointID: 0 CommentTypeID: 0 CommentType: @@ -1773,8 +1773,8 @@ components: IsAutomatedCheckin: true IsPositive: true MediaItems: - - ID: string - ChargePointID: string + - ID: 0 + ChargePointID: 0 ItemURL: string ItemThumbnailURL: string Comment: string From 02e3df582dd447cf48bd45b5246fc2a906d90e05 Mon Sep 17 00:00:00 2001 From: Evan Wies Date: Fri, 1 Mar 2024 06:46:10 -0500 Subject: [PATCH 2/2] Add x-go-name annotation for Golang users When using oapi-codegen, I was receiving the following error: ``` error generating code for type definitions: duplicate typename 'POI' detected, can't auto-rename, please use x-go-name to specify your own name for one of them ``` Thus this adds `x-go-name: ChargePoint` at the appropriate place. It is an `x-` annotation which are generally ignored by tools that don't use them. --- Model/schema/ocm-openapi-spec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/schema/ocm-openapi-spec.yaml b/Model/schema/ocm-openapi-spec.yaml index d4be0b1..3b47439 100644 --- a/Model/schema/ocm-openapi-spec.yaml +++ b/Model/schema/ocm-openapi-spec.yaml @@ -439,6 +439,7 @@ components: schemas: POI: title: POI + x-go-name: ChargePoint type: object description: |- A POI (Point of Interest), also referred to as a `Site` or `ChargePoint`, is the top-level set of information regarding a geographic site with one or more electric vehicle charging equipment present. The term `ChargePointID` is used to reference the unique ID for each POI, as called OCM ID. This reference appears in various UI elements in the format `OCM-12345` to distinguish the ID number as being a reference for a specific POI/site.