MCPcopy Index your code
hub / github.com/YeDaxia/JApiDocs

github.com/YeDaxia/JApiDocs @v1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1 ↗ · + Follow
628 symbols 1,256 edges 89 files 141 documented · 22% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Introduction

Click hear to check the example.

JApiDocs is a Java programming tool that complies with the Java programming conventions. JApiDocs will help you to export a beautiful Html document and generate relevant Java and Object-C related data model code, this will reduce Android And IOS Client Developers's work, and you do not need to work hard to maintain changes in the api documents, just need to maintain your code.

Features

  1. A Controller as a set of api export to a html file.
  2. Support Java And Object-C Model Code generation.
  3. Depth support Spring Boot, Play Framework, JFinal, no need to declare additional routing.
  4. Support the general Java Web project, need to add additional routing in the relevant annotation.
  5. Support interface statement outdated (@Deprecated), convenient document directory and so on.
  6. Support for custom code generation templates.

Quick Start

  1. In spring, for example, the image below will help you easilly to understand how JApidocs works. As you can see, you can done your work so naturally. the only extra part is the @ApiDoc, we will discuss this below.

  2. @ApiDoc is a custom annatation, as we known, unless we run the program , otherwise we can not know what the response really contains. To solve this problem, we bring into View Class, we can know what will return in the response by the View Class, and JApiDocs will read every member of it and its parent class except the static member. this is why @ApiDoc exists.

you can just simplly include our jar or create a class naming ApiDoc in your project, it doesn't care where package it belongs.

@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.METHOD})
public @interface ApiDoc {

    /**
     * result class
     * @return
     */
    Class<?> value() default Null.class;

    /**
     * result class
     */
    Class<?> result() default Null.class;

    /**
     * request url
     */
    String url() default "";

    /**
     * request method
     */
    String method() default "get";

    final class Null{

    }
}
  1. run to generate docs

command line mode

(1) download the jar end with all. (2) create a file name docs.config, the properties contains:

projectPath = your project root path(required)
docsPath = the output docs path(not required,defualt ${projectPath}/apidocs)
codeTplPath = the custom code template path (not required)
mvcFramework = [spring, play, jfinal, generic](not required,JApiDocs will try to find which framework you are using, but sometimes it may not work, so you can set this to let it know).

java code mode

(1) add dependencies below:

compile 'io.github.yedaxia:japidocs:1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.github.javaparser:javaparser-core:3.3.0'

(2) one line simple java code:

Docs.buildHtmlDocs(DocsConfig config);
  1. custom java or object-c code:

copy the template files in the project, and make the template you like:

Notes

  1. not support cycle class:
class UserVO{
    BookVO book;
}

class BookKVO{
    UserVO user;
}
  1. Jfinal Users should put the routes in the method configRoute:
@Override
public void configRoute(Routes me) {
    me.add("/api/v1/user", UserController.class);
    me.add("/api/v1/book", BookController.class);
    me.add(new AmdinRoutes());
}

License

JApiDocs is available under the Apache 2 License. Please see the Licensing section for more information.

Extension points exported contracts — how you extend this code

ICodeBuilder (Interface)
@author yeguozhong yedaxia.github.com [14 implementers]
library/src/main/java/io/github/yedaxia/apidocs/codegenerator/ICodeBuilder.java
IControllerDocBuilder (Interface)
an interface of build a controller api docs @author yeguozhong yedaxia.github.com [2 implementers]
library/src/main/java/io/github/yedaxia/apidocs/doc/IControllerDocBuilder.java
IResponseWrapper (Interface)
wrap response into a common structure, you should put the response into a map , for now this just use for upload apis t [1 …
library/src/main/java/io/github/yedaxia/apidocs/IResponseWrapper.java
IFieldProvider (Interface)
(no doc) [2 implementers]
library/src/main/java/io/github/yedaxia/apidocs/codegenerator/IFieldProvider.java

Core symbols most depended-on inside this repo

error
called by 20
library/src/main/java/io/github/yedaxia/apidocs/LogUtils.java
getValue
called by 19
library/src/main/java/io/github/yedaxia/apidocs/parser/MockNode.java
getDescription
called by 17
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Action.java
getType
called by 15
library/src/main/java/io/github/yedaxia/apidocs/parser/FieldNode.java
searchJavaFile
called by 14
library/src/main/java/io/github/yedaxia/apidocs/ParseUtils.java
compilationUnit
called by 13
library/src/main/java/io/github/yedaxia/apidocs/ParseUtils.java
info
called by 13
library/src/main/java/io/github/yedaxia/apidocs/LogUtils.java
getName
called by 13
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Page.java

Shape

Method 487
Class 86
Function 48
Interface 5
Enum 2

Languages

Java92%
TypeScript8%

Modules by API surface

playDemo/public/javascripts/jquery-1.6.4.min.js48 symbols
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Project.java39 symbols
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Parameter.java28 symbols
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Action.java24 symbols
library/src/main/java/io/github/yedaxia/apidocs/Docs.java24 symbols
library/src/main/java/io/github/yedaxia/apidocs/Utils.java21 symbols
library/src/main/java/io/github/yedaxia/apidocs/DocContext.java15 symbols
library/src/main/java/io/github/yedaxia/apidocs/parser/RequestNode.java14 symbols
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Page.java14 symbols
library/src/main/java/io/github/yedaxia/apidocs/ext/rap/Module.java14 symbols
library/src/main/java/io/github/yedaxia/apidocs/parser/ClassNode.java13 symbols
library/src/main/java/io/github/yedaxia/apidocs/codegenerator/model/FieldModel.java13 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add JApiDocs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact