Skip to content

Force usage of concrete numeric types instead of number #1096

@sethmlarson

Description

@sethmlarson

Feature Proposal

Outside of the _types/Numeric.ts file using the number type shouldn't be allowed. Instead should require using one of the types outlined in _types/Numeric.ts like integer, float, long, etc. Doing so should result in an error in the compiler that shows the user which types to use instead.

Motivation

Generators use information from either integer/long or float/double to decide what data type to use from their language. For example in Python I decide between int and float, but when a type is number but should be integer/long I have to default to the less restrictive option float in Python which can result in a type that Elasticsearch doesn't actually accept being "usable" type-wise from the client.

Static type languages have it worse, likely having to select double when given number?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions