mirror of
https://github.com/gotson/komga.git
synced 2026-05-07 03:51:02 +02:00
fix(api): return null for UserDto.ageRestriction instead of omitting field
Reverts the @JsonInclude(NON_NULL) annotation added in e3a8cc6 which broke
external API clients that deserialize KomgaUser with ageRestriction as a
required field. Omitting the field entirely causes deserialization errors
for clients like komga-client when the admin user has no age restriction set.
This commit is contained in:
parent
9c84690a07
commit
df3ded9f67
2 changed files with 1 additions and 3 deletions
|
|
@ -1,12 +1,10 @@
|
|||
package org.gotson.komga.interfaces.api.rest.dto
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude
|
||||
import org.gotson.komga.domain.model.AgeRestriction
|
||||
import org.gotson.komga.domain.model.AllowExclude
|
||||
import org.gotson.komga.domain.model.KomgaUser
|
||||
import org.gotson.komga.infrastructure.security.KomgaPrincipal
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
data class UserDto(
|
||||
val id: String,
|
||||
val email: String,
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class UserControllerTest(
|
|||
jsonPath("$.sharedLibrariesId") { doesNotExist() }
|
||||
jsonPath("$.labelsAllow") { isEmpty() }
|
||||
jsonPath("$.labelsExclude") { isEmpty() }
|
||||
jsonPath("$.ageRestriction") { doesNotExist() }
|
||||
jsonPath("$.ageRestriction") { isEmpty() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue