Skip to content

Function declaration without endpoint main module does not throw errors #974

@georgeajit

Description

@georgeajit

Version of MarkLogic Java Client API

4.1

Version of MarkLogic Server

10.0 nightly build

Java version

1.8

OS and version

Windows / Cygwin

Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end

Installed the latest development-tools jar using

./gradlew marklogic-development-tools:Jar
./gradlew marklogic-development-tools:publishToMavenLocal

Created a dummy gradle project with build.gradle

buildscript{
    repositories {
        mavenLocal()
		mavenCentral()
		jcenter()
		maven { url 'http://developer.marklogic.com/maven2' }
        dependencies{
            classpath group: 'com.marklogic', name: 'marklogic-development-tools', version: '4.1'			
        }
    }
}

plugins {
    id 'java'
}

apply plugin: 'java'
apply plugin: com.marklogic.client.tools.gradle.ToolsPlugin

group 'com.marklogic'
version '4.1'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

dependencies {
    compile ('marklogic-development-tools:4.1')	
}

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven { url 'http://developer.marklogic.com/maven2' }
}

task generateTestProxyWithBothParams(type: com.marklogic.client.tools.gradle.EndpointProxiesGenTask) {
    serviceDeclarationFile = 'src/main/ml-modules/root/simple/service.json'
	javaBaseDirectory='src/main/ml-modules/root/simple/output/'
}

API declaration file:

{
  "functionName" : "incrementer",
  "params" : [ {
    "name" : "input",
    "datatype" : "decimal"
  } ],
  "return" : {
    "datatype" : "string"
  }
}

Service declaration file:

{
  "endpointDirectory" : "/simple/",
  "$javaClass" : "com.marklogic.client.test.Simple"
}

Ran the following task without having a main module:

gradle generateTestProxyWithBothParams

Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)

:generateTestProxyWithBothParamsfunction declaration without endpoint main module: C:\space\b9_0\markLogicDevelopmentToolsFunctionalTest\marklogic-development-tools-functionattests\src\main\ml-modules\root\simple\incrementer.api

It is also seen that the utility function generates an interface without any method declarations inside such as this:

package com.marklogic.client.test;

// IMPORTANT: Do not edit. This file is generated.



import com.marklogic.client.DatabaseClient;

import com.marklogic.client.impl.BaseProxy;

/**
 * Provides a set of operations on the database server
 */
public interface Simple {
    /**
     * Creates a Simple object for executing operations on the database server.
     *
     * The DatabaseClientFactory class can create the DatabaseClient parameter. A single
     * client object can be used for any number of requests and in multiple threads.
     *
     * @param db	provides a client for communicating with the database server
     * @return	an object for session state
     */
    static Simple on(DatabaseClient db) {
        final class SimpleImpl implements Simple {
            private BaseProxy baseProxy;

            private SimpleImpl(DatabaseClient dbClient) {
                baseProxy = new BaseProxy(dbClient, "/simple/");
            }

        }

        return new SimpleImpl(db);
    }

}

Expected output: What specifically did you expect to happen?

Throw an error and may be do not generate the interface.

Alternatives: What else have you tried, actual/expected?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions