diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswer.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswer.kt index d746c840..2a9619f8 100644 --- a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswer.kt +++ b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswer.kt @@ -6,6 +6,7 @@ import dev.dres.data.model.media.MediaItemId import dev.dres.data.model.submissions.DbAnswer import dev.dres.data.model.submissions.DbAnswerType import io.javalin.openapi.OpenApiIgnore +import io.javalin.openapi.OpenApiNullable import kotlinx.dnq.query.filter import kotlinx.dnq.query.singleOrNull import kotlinx.serialization.Serializable @@ -21,6 +22,7 @@ import kotlinx.serialization.Serializable @Serializable data class ApiClientAnswer( //TODO add optional relevance score field /** The text that is part of this [ApiClientAnswer]. */ + @get:OpenApiNullable val text: String? = null, /** The [MediaItemId] associated with the [ApiClientAnswer]. Is usually added as contextual information by the receiving endpoint. */ @@ -29,15 +31,19 @@ data class ApiClientAnswer( //TODO add optional relevance score field val mediaItemId: MediaItemId? = null, /** The name of the media item that is part of the answer. */ + @get:OpenApiNullable val mediaItemName: String? = null, /** The name of the collection the media item belongs to. */ + @get:OpenApiNullable val mediaItemCollectionName: String? = null, /** For temporal [ApiClientAnswer]s: Start of the segment in question in milliseconds. */ + @get:OpenApiNullable val start: Long? = null, /** For temporal [ApiClientAnswer]s: End of the segment in question in milliseconds. */ + @get:OpenApiNullable val end: Long? = null, ) { diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswerSet.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswerSet.kt index c3a9ad7d..c565a07c 100644 --- a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswerSet.kt +++ b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/submission/ApiClientAnswerSet.kt @@ -6,6 +6,7 @@ import dev.dres.data.model.submissions.AnswerSetId import dev.dres.data.model.submissions.DbAnswerSet import dev.dres.data.model.submissions.DbVerdictStatus import io.javalin.openapi.OpenApiIgnore +import io.javalin.openapi.OpenApiNullable import kotlinx.dnq.query.addAll import kotlinx.dnq.query.filter import kotlinx.dnq.query.first @@ -21,7 +22,12 @@ import java.util.* * @version 1.0.0 */ @Serializable -data class ApiClientAnswerSet(var taskId: String? = null, val taskName: String? = null, val answers: List) { +data class ApiClientAnswerSet( + @get:OpenApiNullable + var taskId: String? = null, + @get:OpenApiNullable + val taskName: String? = null, + val answers: List) { /** The [AnswerSetId] of this [ApiClientAnswerSet]. Typically generated by the receiving endpoint. */ @JsonIgnore diff --git a/doc/oas-client.json b/doc/oas-client.json index 7d7e9446..c86a9a59 100644 --- a/doc/oas-client.json +++ b/doc/oas-client.json @@ -2,8 +2,8 @@ "openapi" : "3.0.3", "info" : { "title" : "DRES Client API", - "version" : "2.0.2", - "description" : "Client API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.2" + "version" : "2.0.3-SNAPSHOT", + "description" : "Client API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.3-SNAPSHOT" }, "paths" : { "/api/v2/client/evaluation/currentTask/{evaluationId}" : { @@ -1605,21 +1605,26 @@ "additionalProperties" : false, "properties" : { "text" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "mediaItemName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "mediaItemCollectionName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "start" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "nullable" : true }, "end" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "nullable" : true } } }, @@ -1628,10 +1633,12 @@ "additionalProperties" : false, "properties" : { "taskId" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "taskName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "answers" : { "type" : "array", diff --git a/doc/oas.json b/doc/oas.json index bb05416f..f64a75e6 100644 --- a/doc/oas.json +++ b/doc/oas.json @@ -2,8 +2,8 @@ "openapi" : "3.0.3", "info" : { "title" : "DRES API", - "version" : "2.0.2", - "description" : "API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.2", + "version" : "2.0.3-SNAPSHOT", + "description" : "API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.3-SNAPSHOT", "contact" : { "name" : "The DRES Dev Team", "url" : "https://dres.dev" @@ -6019,21 +6019,26 @@ "additionalProperties" : false, "properties" : { "text" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "mediaItemName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "mediaItemCollectionName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "start" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "nullable" : true }, "end" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "nullable" : true } } }, @@ -6042,10 +6047,12 @@ "additionalProperties" : false, "properties" : { "taskId" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "taskName" : { - "type" : "string" + "type" : "string", + "nullable" : true }, "answers" : { "type" : "array",