Skip to content

Fix Application.providers field type: List<String> → List<ProviderItem>#126

Closed
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-sdk-application-creation
Closed

Fix Application.providers field type: List<String> → List<ProviderItem>#126
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-sdk-application-creation

Conversation

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Application.providers was typed as List<String>, causing the Go backend to reject create/update requests with json: cannot unmarshal string into Go struct field Application.providers of type object.ProviderItem.

Changes

  • New ProviderItem entity — mirrors the Go ProviderItem struct with fields owner, name, canSignUp, canSignIn, canUnlink, countryCodes, prompted, signupGroup, rule, and a nested Provider provider
  • Application.providers — changed from List<String> to List<ProviderItem>
  • Removed Application.providerObjs — this List<Provier> field had no matching field in the Go struct and is superseded by the corrected providers

Usage

ProviderItem item = new ProviderItem("admin", "my-google-provider");
item.canSignUp = true;
item.canSignIn = true;

Application app = new Application("admin", "my-app", ...);
app.providers = List.of(item);
applicationService.addApplication(app);
Original prompt

This section details on the original issue you should resolve

<issue_title>To create a new application using SDK (version 1.42.0) but fail</issue_title>
<issue_description>To create a new application using SDK (version 1.42.0), you need to pass the parameter 'providers', which is of type List. What are the parameters passed? I have tried passing List. of (name) and JSON provider object, but both have encountered an error message: "json: cannot unmarshal string into Go struct field Application. supporters of type object. ProviderItem." What exactly is being passed? @hsluoyz </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…erItem>

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix application creation issue with SDK version 1.42.0 Fix Application.providers field type: List&lt;String&gt; → List&lt;ProviderItem&gt; Feb 26, 2026
@hsluoyz hsluoyz marked this pull request as ready for review February 26, 2026 10:13
@hsluoyz

hsluoyz commented Feb 26, 2026

Copy link
Copy Markdown
Member

@weiweiou

@codecov

codecov Bot commented Feb 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (75e5a4c) to head (5d605c9).

Files with missing lines Patch % Lines
...n/java/org/casbin/casdoor/entity/ProviderItem.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #126   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          94      95    +1     
  Lines        1397    1403    +6     
  Branches       36      36           
======================================
- Misses       1397    1403    +6     

☔ 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.

@weiweiou

weiweiou commented Feb 27, 2026

Copy link
Copy Markdown

please ~ not successful !

@weiweiou

weiweiou commented Mar 2, 2026

Copy link
Copy Markdown

Please as soon as possible, I'm waiting for the update @hsluoyz

@hsluoyz

hsluoyz commented Mar 2, 2026

Copy link
Copy Markdown
Member

@weiweiou do you have AI? Can you make a PR instead?

@weiweiou

weiweiou commented Mar 3, 2026

Copy link
Copy Markdown

how?add providerItem.class and change provider.class ? use claude code ?@hsluoyz

@nomeguy nomeguy closed this Mar 5, 2026
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.

To create a new application using SDK (version 1.42.0) but fail

5 participants