@platformatic/sql-json-schema-mapper 3.58.1 → 3.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -188,6 +188,11 @@ function renderProperties (
|
|
|
188
188
|
types = [type]
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// The mapper always returns primary keys as strings
|
|
192
|
+
if (fieldDefinitions[name]?.primaryKey) {
|
|
193
|
+
types = Array.from(new Set(types.map(t => (t === 'integer' || t === 'number' ? 'string' : t))))
|
|
194
|
+
}
|
|
195
|
+
|
|
191
196
|
if (nullable && types.indexOf('null') === -1) {
|
|
192
197
|
types.push('null')
|
|
193
198
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/sql-json-schema-mapper",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.60.0",
|
|
4
4
|
"description": "Map SQL entity to JSON schema",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"neostandard": "^0.12.0",
|
|
23
23
|
"typescript": "^5.5.4",
|
|
24
24
|
"why-is-node-running": "^2.2.2",
|
|
25
|
-
"@platformatic/sql-mapper": "3.
|
|
25
|
+
"@platformatic/sql-mapper": "3.60.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"code-block-writer": "^13.0.1",
|