Skip to content

Conversation

@bhelx
Copy link
Contributor

@bhelx bhelx commented Nov 11, 2024

  • We should check the format of integer
  • int32 and int64 are only the domain of type: integer

* We should check the format of `integer`
* int32 and int64 are only the domain of type: integer
return new Int32Type(s)
if (s.format === 'int32') return new Int32Type(s)
if (s.format === 'int64') return new Int64Type(s)
this.recordError(`IDK how to parse this integer: ${s.format}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should decide what to do when there is no format for type = number and integer. OpenAPI supports generic numbers and ints: https://swagger.io/docs/specification/v3_0/data-models/data-types/

I think perhaps we want to default them to double and int64 respectively. Maybe after we rollout int64 support everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna default to int64 as not to break any documents that may have been using integer without a format. so will need to update all the bindgens before upgrading this library.

@bhelx bhelx force-pushed the fix-int64-normalization branch from c2d5b0f to e2c924c Compare November 11, 2024 16:11
@bhelx bhelx merged commit 1785606 into main Nov 11, 2024
3 checks passed
@bhelx bhelx deleted the fix-int64-normalization branch November 11, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants