admin openapi spec needs bigger integers in places #476
Labels
No labels
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#476
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am using the golang SDK and I have noticed that large numbers are not being marshalled correctly.
A runtime example:
error from GetBucketUsage json: cannot unmarshal number 510365619034 into Go struct field BucketInfo.bytes
This appears to be due to the SDK generator creating an int field where an int64 field type is necessary.
I believe the generator will use int64 if the specification file includes a format property set to
int64
where the data type isinteger
.The openapi spec file I referenced was garage-admin-v0.yml.
I would be happy to edit that file and make a pull request if this is the source of truth for the API tools. (In other words I am not sure whether or not this file is generated.)
So in any case I believe where the sizes can be large the API specification should include format int64 in the spec file so the generated SDK will use int64.
Afaik
garage-admin-v0.yml
is the source of truth, but we need confirmation from @quentinIndeed the source of truth for the API is the file you identified in this repository: garage-admin-v0.yml. In a general manner, we try to keep the source of truths for Garage in this repository while keeping "children" projects outside (like the website or the SDKs).
Once this file will be patched and merged on Garage's main branch, the next step will be to update the garage-sdk/garage-admin-sdk-generator repository. In this repository, Garage is included as a submodule, submodule I will update to fetch your bug fix. Then I will regenerate the 3 SDKs from here, commit and push the modification, so that both the Python, JS, and Golang SDK benefit from your patch AND stay in sync.
So just ping me when your PR is ready, I will udpdate the SDKs ASAP after that.
Fixed by #480