Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] inaccurate numeric type #596

Open
amberzsy opened this issue Oct 2, 2024 · 6 comments
Open

[BUG] inaccurate numeric type #596

amberzsy opened this issue Oct 2, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@amberzsy
Copy link
Contributor

amberzsy commented Oct 2, 2024

What is the bug?

there are many places using generic "number" as numeric type.

How can one reproduce the bug?

example:

What is the expected behavior?

should use more accurate definition for numeric types.
https://swagger.io/docs/specification/v3_0/data-models/data-types/

@dblock
Copy link
Member

dblock commented Oct 16, 2024

@amberzsy Is there more than #598 and #612?

I think we need a lint rule for these.

@amberzsy
Copy link
Contributor Author

amberzsy commented Oct 16, 2024

@amberzsy Is there more than #598 and #612?

yes probably more.....
maybe let me update the ticket with scope of Search & Document API?

I think we need a lint rule for these.

yes, agree. issue opened here

@nhtruong
Copy link
Collaborator

@amberzsy are you saying that many of these should be integer instead of number? Or are you asking if we should add a format for number to clarify the precision of number?

@Xtansia
Copy link
Collaborator

Xtansia commented Feb 2, 2025

@amberzsy are you saying that many of these should be integer instead of number? Or are you asking if we should add a format for number to clarify the precision of number?

I think it's just that they should be correctly specified according to the actual API, which ideally has the end goal of all having format specified (and some should be type: integer), but it's not an identical fix everywhere.

@amberzsy
Copy link
Contributor Author

amberzsy commented Feb 2, 2025

@amberzsy are you saying that many of these should be integer instead of number? Or are you asking if we should add a format for number to clarify the precision of number?

we should be more precise on numeric type and align with actual API definition. there's no ideal approach to systematically fix all numeric type with certain reverse engineering. So i guess we will need to fix those incrementally while we adding more GRPC API.
the two PR i raised is mostly focus on Search and Document API.

I think it's just that they should be correctly specified according to the actual API, which ideally has the end goal of all having format specified (and some should be type: integer), but it's not an identical fix everywhere.

correct.

@nhtruong
Copy link
Collaborator

nhtruong commented Feb 3, 2025

We should totally have the format added for every number/integer schema, as an end goal. The question spawned off from this discussion as I wanted to clarify if this is a major pain point for our user. Having integers described as number will definitely cause trouble, and I wasn't sure if the missing format would have the same level of severity to so we can prioritize our resources.

We should definitely ask contributors to determine the format for new number/integer schemas and fill that in for existing schemas overtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants