Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix kotlin no-arg constructor #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion build.gradle.kts
Expand Up @@ -6,6 +6,12 @@ version = "1.0-SNAPSHOT"
plugins {
kotlin("jvm") version "1.3.41"
application
id("org.jetbrains.kotlin.plugin.noarg") version "1.3.41"
}

noArg {
annotation("com.example.issue.NoArg")
invokeInitializers = true
}

application {
Expand All @@ -27,7 +33,7 @@ dependencies {
implementation("com.arangodb:arangodb-java-driver-async:5.0.7")

// ArangoDB Velocypack plugin for Jackson
implementation("com.arangodb:jackson-dataformat-velocypack:0.1.1")
implementation("com.arangodb:jackson-dataformat-velocypack:0.1.3")

// Jackson Serialization
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.7")
Expand Down
30 changes: 30 additions & 0 deletions src/main/kotlin/com/example/issue/NoArg.kt
@@ -0,0 +1,30 @@
package com.example.issue

/*
* DISCLAIMER
*
* Copyright 2016 ArangoDB GmbH, Cologne, Germany
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright holder is ArangoDB GmbH, Cologne, Germany
*/


/**
* @author Michele Rastelli
*/

@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.SOURCE)
annotation class NoArg
3 changes: 2 additions & 1 deletion src/main/kotlin/com/example/issue/main.kt
Expand Up @@ -7,6 +7,7 @@ import com.fasterxml.jackson.module.kotlin.KotlinModule
import kotlinx.coroutines.future.await
import kotlinx.coroutines.runBlocking

@NoArg
data class Record(
val _key: String,
val _rev: String,
Expand All @@ -23,7 +24,7 @@ fun main() {
.db("playground").collection("test")

val failing: ArangoCollectionAsync = ArangoDBAsync.Builder().user("root").password("root")
.setSerializer(VelocyJack().apply { configure { it.registerModule(KotlinModule()) } })
.serializer(VelocyJack().apply { configure { it.registerModule(KotlinModule()) } })
.build()
.db("playground").collection("test")

Expand Down