-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix bugs on and add missing fields to OpenAPI spec #2457
Fix bugs on and add missing fields to OpenAPI spec #2457
Conversation
@@ -1080,19 +1080,21 @@ components: | |||
expiry_timestamp: | |||
example: null | |||
nullable: true | |||
fee_schedule_key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: number | ||
example: 9223372036854775807 | ||
type: string | ||
example: "9223372036854775807" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: number | ||
example: 1000000 | ||
type: string | ||
example: "1000000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: string | ||
format: byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type: string
specifies that it is string. The optional format: byte
indicates that it is base64 encoded.. See the data types section in the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, learned something new! :) Let me revert this locally and get it working as it was originally.
entity_id: | ||
type: string | ||
bytes: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fields were missing, which causes any generated client code to fail when invoked (fee_schedule_key
as well).
Codecov Report
@@ Coverage Diff @@
## main #2457 +/- ##
=========================================
Coverage 91.58% 91.58%
Complexity 2534 2534
=========================================
Files 420 420
Lines 11591 11591
Branches 1016 1016
=========================================
Hits 10616 10616
Misses 644 644
Partials 331 331
Continue to review full report at Codecov.
|
2902355
to
7def82f
Compare
Signed-off-by: Long Nguyen <[email protected]> Undo changes and add format: bytes Signed-off-by: Long Nguyen <[email protected]> Byte, not bytes Change supply fields back to strings Signed-off-by: Long Nguyen <[email protected]>
7def82f
to
652e3c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Signed-off-by: Long Nguyen [email protected]
Description:
This PR modifies our OpenAPI spec YAML file to fix some glaring bugs that pass client generation, but do not pass actual usage when writing real code that attempts to talk to the REST API.
Related issue(s): #2447
Fixes #
Notes for reviewer:
tokenid
->tokenId
The API spec had this case typo, which trickles down into the generated Jersey client and causes us to fail to send the right query parameter.transaction.bytes
,transaction.entity_id
, andtoken.fee_schedule_key
. From now on, if you add any new fields to any objects in the API, please add them to the spec as well. OpenAPI Generator does not have an option to inject the generated client files with@IgnoreUnknownProperties
, and likely never will, so any time the generated client sees an unknown property, it fails fast and breaks downstream code.api/v1/transactions
can actually take multiple timestamp constraints to provide a clear search window with left and right boundaries, ex. https://mainnet-public.mirrornode.hedera.com/api/v1/transactions?timestamp=lte:2000000000.711927001&×tamp=gte:1500000000.711927001. I updated the spec to reflect this, and it does work as expected (Jersey will send all parameters).Checklist