cstroe / swagger-ant-task

An ant task that generates swagger JSON spec files from Java code.
Apache License 2.0
3 stars 3 forks source link

my code is inside src directly and not in src/main/java and apis are not scanned #3

Open jcodemani opened 7 years ago

jcodemani commented 7 years ago

Hi,

      I also copied code under src/main/java and running the ant task.

so the directory structure was src

I ran the task from above src folder which is root folder of my project still it is not detecting the apis

I do not use maven and I am using apache wink for rest api implementation. Can you please suggest any other workaround or plugin that I can use to generate swagger doc at compile time??

Thanks, jcodemani

cstroe commented 7 years ago

If your source code is under src and not src/main/java, I would recommend making a symlink:

cd src
mkdir main
cd main
ln -s ../../src java

Let me know how that works.

jcodemani commented 7 years ago

I tried it out still it is not generating proper document it is generating the following documentation: { "apiVersion" : "v1", "swaggerVersion" : "1.2", "basePath" : "https://insu.rti.com/insu/users" }

in service.json

Following are the logs:

swaggertask.first: [swagger] log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter). [swagger] log4j:WARN Please initialize the log4j system properly. [swagger] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [swagger] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". [swagger] SLF4J: Defaulting to no-operation (NOP) logger implementation [swagger] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

com.rti.api.poc.rest /rtiapi v1 generated/swagger-ui https://insu.rti.com/insu/users false
jcodemani commented 7 years ago
com.ibm.cm.api.contract.rest /cmapi v1 generated/swagger-ui https://insu.rti.com/insu/users false