Skip to content

Commit

Permalink
Fixes issue with InputData subtypes not being exposed properly in API.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Gasser <[email protected]>
  • Loading branch information
ppanopticon committed Dec 10, 2024
1 parent 6c97840 commit 5751a04
Show file tree
Hide file tree
Showing 3 changed files with 2,216 additions and 2 deletions.
3 changes: 3 additions & 0 deletions vitrivr-engine-query/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ plugins {

dependencies {
api project(':vitrivr-engine-core')

/* Open API annotations. */
implementation group: 'io.javalin.community.openapi', name: 'javalin-openapi-plugin', version: version_javalin
}

/* Publication of vitrivr engine query to Maven Central. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.vitrivr.engine.query.model.api.input

import io.javalin.openapi.Discriminator
import io.javalin.openapi.DiscriminatorProperty
import io.javalin.openapi.OneOf
import kotlinx.serialization.Serializable
import org.vitrivr.engine.core.model.content.element.ContentElement
import org.vitrivr.engine.core.model.content.element.ImageContent
Expand All @@ -15,6 +18,18 @@ import java.util.*
* The abstract [InputData], essentially a query's input value.
*/
@Serializable(with = InputDataSerializer::class)
@OneOf(
discriminator = Discriminator(DiscriminatorProperty("type", type = InputType::class)),
value = [
TextInputData::class,
ImageInputData::class,
VectorInputData::class,
RetrievableIdInputData::class,
BooleanInputData::class,
NumericInputData::class,
DateInputData::class
]
)
sealed class InputData() {
/**
* The [InputType] of this [InputType]. Required for polymorphic deserialisation.
Expand Down
Loading

0 comments on commit 5751a04

Please sign in to comment.