Mark Vogel
01/25/2023, 10:21 PMswagger-codegen-generators
.
I'm open to suggestions for how to do this; trying to explore the options that are out thereSergey Shumov
01/26/2023, 6:20 AMAleksei Tirman [JB]
01/26/2023, 8:20 AMdino9
01/26/2023, 2:04 PMribesg
01/26/2023, 2:05 PM@Resource("{id}")
@Serializable
data class FileResource(val parent: FilesResource = FilesResource(), val id: FileId) {
// Swagger data
object Get : ResourceDescription by describeResource({
operationId = "getFile"
summary = "Gets an existing file's download URL"
tags += "File"
"id" pathParameter {
description = "The id of the file to get"
example = "file-id.pdf"
required = true
}
200 response {
json { schema(DownloadResponse("http://…/file-id.pdf")) }
}
})
// Swagger data
object Delete : ResourceDescription by describeResource({
operationId = "deleteFile"
summary = "Deletes an existing file"
tags += "File"
"id" pathParameter {
description = "The id of the file to delete"
example = "file-id.pdf"
required = true
}
200 response {
description = "File deleted"
}
})
@Serializable
data class DownloadResponse(val url: String)
}
Mark Vogel
01/26/2023, 3:26 PM