question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sql-json-schema-mapper maps decimal to integer

See original GitHub issue

Hello, I was trying to write tests for my PR and saw this.

function mapSQLTypeToOpenAPIType (sqlType) { // TODO support more types /* istanbul ignore next */ switch (sqlType) { case 'int': return 'integer' case 'integer': return 'integer' case 'tinyint': return 'integer' case 'smallint': return 'integer' case 'decimal': return 'integer'

https://github.com/platformatic/platformatic/blob/ad41cccff21ef64a0fc129f9bc42b6414108b6fd/packages/sql-json-schema-mapper/index.js#L15

Is it designed like this or is it a bug?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kivancbilencommented, Dec 16, 2022

we are expecting a number @cesarvspr

0reactions
cesarvsprcommented, Dec 18, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Numeric types — Understanding JSON Schema 2020-12 ...
There are two numeric types in JSON Schema: integer and number. ... Therefore, the presence or absence of a decimal point is not...
Read more >
Schema and data type mapping in copy activity - Microsoft Learn
This article describes how the Azure Data Factory copy activity perform schema mapping and data type mapping from source data to sink data....
Read more >
Why would you use a string in JSON to represent a decimal ...
The main reason to transfer numeric values in JSON as strings is to eliminate any loss of precision or ambiguity in transfer. It's...
Read more >
CData JDBC Driver for JSON - Data Type Mapping
Schema.NET JDBC SQLite int, integer, int32 Int32 int integer smallint, short, int16 Int16 short integer double, float, real Double double double
Read more >
MySQL / MSSQL : numeric.mapping doesn't work for ... - GitHub
I can't get numeric.mapping to work with MySQL and Confluent Platform ... transactions ( txn_id INT, customer_id INT, amount DECIMAL(5,2), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found