Skip to content

fix(binding): use UnmarshalText for types like enum #1359

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

xiaost
Copy link
Contributor

@xiaost xiaost commented May 21, 2025

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
for enum type we generate String() and use it by default for sending requests.
if users also use the type for binding, it will fail with strconv.ParseInt err.
This change make use of the generated UnmarshalText func and fall back to strconv.ParseInt if any err.

zh(optional):

Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.00%. Comparing base (faae220) to head (92a0323).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
...rver/binding/internal/decoder/base_type_decoder.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1359      +/-   ##
===========================================
+ Coverage    73.68%   74.00%   +0.31%     
===========================================
  Files          145      145              
  Lines        16860    16878      +18     
===========================================
+ Hits         12423    12490      +67     
+ Misses        3848     3794      -54     
- Partials       589      594       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xiaost xiaost force-pushed the fix/binding-text-unmarshaler branch 3 times, most recently from 3626590 to b5e75ba Compare May 21, 2025 08:54
@xiaost xiaost marked this pull request as ready for review May 21, 2025 08:55
@xiaost xiaost requested review from a team as code owners May 21, 2025 08:55
@xiaost xiaost force-pushed the fix/binding-text-unmarshaler branch from b5e75ba to 92a0323 Compare May 22, 2025 03:32
@xiaost xiaost merged commit 47fff9b into develop May 30, 2025
38 of 39 checks passed
@xiaost xiaost deleted the fix/binding-text-unmarshaler branch May 30, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants