Skip to content

Commit

Permalink
Fix swagger list-of-string type annotation (#6217)
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 authored May 18, 2022
1 parent 409845f commit 48cc2b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
22 changes: 7 additions & 15 deletions app/controllers/DataSetController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@ import com.scalableminds.util.geometry.Vec3Int
import com.scalableminds.util.mvc.Filter
import com.scalableminds.util.tools.DefaultConverters._
import com.scalableminds.util.tools.{Fox, JsonHelper, Math}
import io.swagger.annotations.{
Api,
ApiImplicitParam,
ApiImplicitParams,
ApiOperation,
ApiParam,
ApiResponse,
ApiResponses
}
import io.swagger.annotations._
import javax.inject.Inject
import models.analytics.{AnalyticsService, ChangeDatasetSettingsEvent, OpenDatasetEvent}
import models.binary._
import models.organization.OrganizationDAO
import models.team.TeamDAO
import models.user.{User, UserDAO, UserService}
import oxalis.mail.{MailchimpClient, MailchimpTag}
import oxalis.security.{URLSharing, WkEnv}
import play.api.i18n.{Messages, MessagesProvider}
import play.api.libs.functional.syntax._
import play.api.libs.json._
import utils.ObjectId
import javax.inject.Inject
import models.analytics.{AnalyticsService, ChangeDatasetSettingsEvent, OpenDatasetEvent}
import models.organization.OrganizationDAO
import oxalis.mail.{MailchimpClient, MailchimpTag}
import play.api.mvc.{Action, AnyContent}
import utils.ObjectId

import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
Expand Down Expand Up @@ -330,7 +322,7 @@ Expects:
Array(
new ApiImplicitParam(name = "datasetUpdateTeamsInformation",
required = true,
dataType = "List[String]",
dataType = "com.scalableminds.util.swaggerhelpers.ListOfString",
paramType = "body")))
def updateTeams(@ApiParam(value = "The url-safe name of the organization owning the dataset",
example = "sample_organization") organizationName: String,
Expand Down
5 changes: 1 addition & 4 deletions app/models/annotation/AnnotationUploadService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ import net.liftweb.util.Helpers.tryo
import oxalis.files.TempFileService
import play.api.i18n.MessagesProvider

import scala.concurrent.ExecutionContext

case class UploadedVolumeLayer(tracing: VolumeTracing, dataZipLocation: String, name: Option[String]) {
def getDataZipFrom(otherFiles: Map[String, File]): Option[File] =
otherFiles.get(dataZipLocation)
}

class AnnotationUploadService @Inject()(tempFileService: TempFileService)(implicit ec: ExecutionContext)
extends LazyLogging {
class AnnotationUploadService @Inject()(tempFileService: TempFileService) extends LazyLogging {

private def extractFromNml(file: File, name: String, overwritingDataSetName: Option[String], isTaskUpload: Boolean)(
implicit m: MessagesProvider): NmlParseResult =
Expand Down
1 change: 0 additions & 1 deletion app/models/annotation/WKRemoteTracingStoreClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.scalableminds.util.tools.Fox.bool2Fox
import com.scalableminds.util.tools.JsonHelper.{boxFormat, optionFormat}
import com.scalableminds.webknossos.datastore.SkeletonTracing.{SkeletonTracing, SkeletonTracings}
import com.scalableminds.webknossos.datastore.VolumeTracing.{VolumeTracing, VolumeTracings}
import com.scalableminds.webknossos.datastore.models.datasource.DataSourceLike
import com.scalableminds.webknossos.datastore.rpc.RPC
import com.scalableminds.webknossos.tracingstore.tracings.TracingSelector
import com.scalableminds.webknossos.tracingstore.tracings.volume.ResolutionRestrictions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.scalableminds.util.swaggerhelpers

// Use in swagger annotations for List[String] body type
abstract class ListOfString extends java.util.List[String]

0 comments on commit 48cc2b9

Please sign in to comment.