-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor: Replace Spray JSON with ZIO-JSON in some projects endpoints (DEV-3375) #3095
refactor: Replace Spray JSON with ZIO-JSON in some projects endpoints (DEV-3375) #3095
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3095 +/- ##
==========================================
+ Coverage 11.74% 12.89% +1.15%
==========================================
Files 246 260 +14
Lines 22907 22385 -522
==========================================
+ Hits 2690 2887 +197
+ Misses 20217 19498 -719 ☔ View full report in Codecov by Sentry. |
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.
Looks good, but please check my questions/suggestions:
integration/src/test/scala/org/knora/webapi/e2e/admin/ProjectsADME2ESpec.scala
Outdated
Show resolved
Hide resolved
@@ -90,6 +89,24 @@ object RouteUtilADM { | |||
} | |||
} | |||
|
|||
def transformResponseIntoExternalFormat( | |||
response: AdminResponse, |
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.
thought: To me the AdminResponse
marker trait feels like a bit to much code for not a real benefit.
Seeing that this function always returns the response
as the same type and even unchanged if it is not doing anything with it I am wondering if we really need a marker trait AdminResponse
. The underlying function could be generic and accept all inputs:
def transformResponseIntoExternalFormat[A](response: A): Task[A]
wdyt?
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.
I implemented it like this to follow the existing pattern (and because at first it seemed hard to get SipiIT
to work without a trait. But in the end this really turned out useless, so I'm happy to remove it.
.description("Returns the project's restricted view settings identified by the shortcode.") | ||
|
||
val getAdminProjectsByProjectShortnameRestrictedViewSettings = baseEndpoints.publicEndpoint.get | ||
.in(projectsByShortname / restrictedViewSettings) | ||
.out(sprayJsonBody[ProjectRestrictedViewSettingsGetResponseADM]) | ||
.out(zioJsonBody[ProjectRestrictedViewSettingsGetResponseADM]) |
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.
praise: Bye bye spray, hello zio. Good stuff, thanks.
Pull Request Checklist
Task Description/Number
Issue Number: DEV-3375
This PR does the following things:
(this includes adding codecs to all response objects and removing the spray stuff)
ADM
suffixinternal -> external
transformation for the updated response objects that does not depend on a trait that is polluted with spray logicPR Type
Basic requirements for bug fixes and features
Does this PR introduce a breaking change?
Does this PR change client-test-data?