-
Notifications
You must be signed in to change notification settings - Fork 92
fix: set primary owner for v4 api import #14163
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: set primary owner for v4 api import #14163
Conversation
6472ee5 to
2fdeab3
Compare
2fdeab3 to
00d2a25
Compare
|
/gemini review |
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.
Code Review
This pull request correctly implements setting the primary owner during a v4 API import. The changes in the domain service and the new tests are well-implemented. I've suggested a small refactoring in the ImportExportApiMapper to improve code clarity and prevent a potential NullPointerException.
...rest/src/main/java/io/gravitee/rest/api/management/v2/rest/mapper/ImportExportApiMapper.java
Outdated
Show resolved
Hide resolved
00d2a25 to
d984c4c
Compare
.../src/test/java/io/gravitee/rest/api/management/v2/rest/mapper/ImportExportApiMapperTest.java
Show resolved
Hide resolved
...rest/src/main/java/io/gravitee/rest/api/management/v2/rest/mapper/ImportExportApiMapper.java
Outdated
Show resolved
Hide resolved
|
Global question: what if the primary owner you are getting from the input payload doesn't exist in the database? (For isntance an export made from another organisation). I think you should check how this use case is handled for V2 import. AFAIR, the user doing the import becomes the new PO if the one in the api definition being imported is not found. |
d984c4c to
1a35056
Compare
In V2 apis, if the user does not exist in the database it sets the PO to the user performing the import, but in case of V4 apis, if the user does not exist we throw an exception saying the user does not exist and halt the import. So let me know if this needs to be changed for V4. |
1a35056 to
14fe0d1
Compare
No it's ok, we can go with this 👍🏻 |
14fe0d1 to
547aa33
Compare
Issue
https://gravitee.atlassian.net/browse/APIM-11286
Description
Setting the primary owner for API import as mentioned in the import definition