fix(management_api): CreateUserIdentity response decodes identity_id … - #60
fix(management_api): CreateUserIdentity response decodes identity_id …#60BrandtKruger wants to merge 3 commits into
Conversation
…from API When creating an identity with an existing enterprise identity, the Kinde API returns identity_id instead of id. Add local OpenAPI spec with identity_id and regenerate SDK so the decoder accepts both; add EffectiveIdentityID() helper. - Add spec/kinde-management-api-spec.yaml (from api-spec.kinde.com) with identity_id on create_identity_response.identity - Update generate.go to use local spec - Regenerate management_api (ogen) so CreateIdentityResponseIdentity has ID and IdentityID; decoder handles both JSON keys - Add create_identity_response_helpers.go with EffectiveIdentityID() - Add create_identity_response_test.go for id and identity_id decode paths Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis PR fixes a typo in the Delete API application-scope operation name across generated server/client/handler code, adds optional/nullable JSON wrapper types and encoding/decoding logic, extends schemas with billing, API-scopes, and organization sign-in fields, adds query parameters (active_since, api_scopes), and introduces an EffectiveIdentityID helper with tests. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@kinde/management_api/oas_schemas_gen.go`:
- Around line 4180-4195: The rename corrected DeleteAPIAppliationScope* →
DeleteAPIApplicationScope* is breaking; restore backward compatibility by adding
type aliases for the old misspelled symbols (e.g., alias
DeleteAPIAppliationScopeBadRequest, DeleteAPIAppliationScopeForbidden,
DeleteAPIAppliationScopeOK, DeleteAPIAppliationScopeTooManyRequests to the new
DeleteAPIApplicationScopeBadRequest, DeleteAPIApplicationScopeForbidden,
DeleteAPIApplicationScopeOK, DeleteAPIApplicationScopeTooManyRequests
respectively) in a separate non-generated compatibility file (or near the
generated types) and also add a clear entry in the changelog/release notes
documenting the rename so downstream consumers can update their imports.
🧹 Nitpick comments (2)
kinde/management_api/oas_json_gen.go (1)
23690-23708: Minor: value assigned before error check in generatedallowed_domainsdecoder.Lines 23695–23697 assign
elem = string(v)before checkingerr. While not a runtime bug (elem isn't used on the error path), this deviates from the typical ogen pattern where the error check precedes the assignment. Since this is generated code, this is likely an ogen quirk — but worth noting if the generator is configurable.v, err := d.Str() elem = string(v) // assigned before err check if err != nil { return err }kinde/management_api/oas_parameters_gen.go (1)
1487-1522: Consider a backward‑compatibility alias for the renamed params type.
Fixing the typo in an exported type can break downstream code; if this isn’t a major release, add a type alias in a non‑generated file to preserve compatibility.
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 3-7: Update the changelog to document the new feature: add an
entry under "Unreleased" (e.g., a "Features" or "Enhancements" subsection)
describing that CreateUserIdentity responses now include identity_id handling
and that a new helper method EffectiveIdentityID() was added to extract/resolve
the effective identity ID; mention any breaking or usage notes for callers that
should use EffectiveIdentityID() to obtain the identity ID. Include the feature
title and brief description alongside the existing typo fix entry so users see
both changes.
…ty_id fix Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing this in favor of #62. The new PR drops the full vendored-spec SDK regen in favor of a small, targeted patch step, avoiding the unrelated breaking changes that got pulled in here. Thanks for the fix, Brandt! |
CreateUserIdentity response decodes identity_id from API
When creating an identity with an existing enterprise identity, the Kinde API returns identity_id instead of id. Add local OpenAPI spec with identity_id and regenerate SDK so the decoder accepts both; add EffectiveIdentityID() helper.
Explain your changes
Suppose there is a related issue with enough detail for a reviewer to understand your changes fully. In that case, you can omit an explanation and instead include either “Fixes #XX” or “Updates #XX” where “XX” is the issue number.
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.