This document provides guidance for developers who want to contribute to APIJSON. It covers the contribution process, bug reporting requirements, and development environment setup. APIJSON welcomes contributions in the form of code improvements, bug fixes, documentation updates, and community support.
For information about the project's development roadmap and planned features, see Development Roadmap.
APIJSON welcomes contributions across multiple technical areas:
| Component | Location | Common Tasks |
|---|---|---|
| Request Parsing | APIJSONORM/src/main/java/apijson/orm/AbstractParser.java400-700 | Add parsing logic, optimize performance |
| SQL Generation | APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java500-1500 | Support new databases, add SQL features |
| Security Validation | APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java150-800 | Enhance role checking, add validation rules |
| Database Execution | APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java50-400 | Optimize caching, improve connection handling |
| Spring Boot Integration | APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/ | Framework-specific features |
| Documentation | README.md Document.md wiki | Clarify usage, add examples |
| Test Coverage | APIJSONORM/src/test/java/ | Add unit tests, integration tests |
| </old_str> |
<new_str>
APIJSON welcomes contributions across multiple technical areas:
| Component | Location | Common Tasks |
|---|---|---|
| Request Parsing | APIJSONORM/src/main/java/apijson/orm/AbstractParser.java400-700 | Add parsing logic, optimize performance |
| SQL Generation | APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java500-1500 | Support new databases, add SQL features |
| Security Validation | APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java150-800 | Enhance role checking, add validation rules |
| Database Execution | APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java50-400 | Optimize caching, improve connection handling |
| Spring Boot Integration | APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/ | Framework-specific features |
| Documentation | README.md Document.md wiki | Clarify usage, add examples |
| Test Coverage | APIJSONORM/src/test/java/ | Add unit tests, integration tests |
Sources: APIJSONORM/src/main/java/apijson/orm/ APIJSON-Java-Server/ CONTRIBUTING.md1-95
As emphasized in CONTRIBUTING.md90-95 there are critical reasons to submit Pull Requests rather than maintaining private forks:
The project strongly recommends submitting Pull Requests for any modifications to ensure compatibility and sustainability.
Sources: CONTRIBUTING.md1-95 README.md208-209
<old_str>
The bug report template (.github/ISSUE_TEMPLATE/bug_report.yml) enforces the following required fields. Issues with missing required fields cannot be submitted.
Specify the exact version from your Maven/Gradle dependencies or GitHub release tag.
Important: Always test with the latest version first. The project maintains only the most recent release (see README.md208), and bug reports for old versions may be closed with a request to upgrade.
Specify the exact database type and version, as behavior varies significantly across versions.
Examples:
MySQL 5.7.34PostgreSQL 13.4ClickHouse 21.8Oracle 19cProvide complete environment details:
- JDK/基础库: OpenJDK 1.8.0_292
- OS/系统: Ubuntu 20.04 LTS (x86_64)
- Framework: Spring Boot 2.5.4
This is the most critical requirement. All bug reports must include complete screenshots from APIAuto
APIAuto provides:
What to screenshot:
Why this is required (from .github/ISSUE_TEMPLATE/bug_report.yml46-50):
"用 APIAuto 能静态检查出很多问题,甚至还有修复建议,不用浪费你我的时间"
Translation: "Using APIAuto can statically detect many problems and even provide fix suggestions, saving everyone's time."
Provide a detailed description including:
Critical warnings from .github/ISSUE_TEMPLATE/bug_report.yml55-56:
"提 bug 请发请求和响应的【完整截屏】,没图的自行解决!"
Translation: "Bug reports must include complete request and response screenshots. Issues without screenshots will not be addressed."
"【描述不详细】 或 【文档/常见问题 已有答案】 的问题可能会被忽略!!"
Translation: "Issues with insufficient detail or that are already answered in documentation/FAQ may be ignored."
Describe what you expected to happen. This helps maintainers understand if the issue is a bug or a misunderstanding of intended behavior.
Sources: .github/ISSUE_TEMPLATE/bug_report.yml1-84 CONTRIBUTING.md170-181 </old_str>
<new_str>
APIJSON follows Conventional Commits for structured commit messages, enabling automatic CHANGELOG generation.
type(scope): subject
[optional body]
[optional footer]
| Type | Description | Affected Files Example |
|---|---|---|
feat | New feature | AbstractSQLConfig.java AbstractSQLExecutor.java |
fix | Bug fix | AbstractVerifier.java AbstractParser.java |
docs | Documentation | README.md Document.md |
style | Code formatting | Any .java file |
refactor | Code restructuring | AbstractParser.java AbstractObjectParser.java |
perf | Performance optimization | AbstractSQLExecutor.java |
test | Add/update tests | APIJSONORM/src/test/java/ |
chore | Build/dependencies | pom.xml build.gradle |
| Scope | Primary Files | Description |
|---|---|---|
orm | APIJSONORM/src/main/java/apijson/orm/ | Core ORM classes |
sql | AbstractSQLConfig.java AbstractSQLExecutor.java | SQL generation/execution |
security | AbstractVerifier.java | Access control |
parser | AbstractParser.java AbstractObjectParser.java | Request parsing |
demo | APIJSON-Java-Server/APIJSONBoot/ | Demo applications |
feat(sql): add TDengine dialect support in AbstractSQLConfig
- Implements getTDengineSQL() method
- Adds TDengine-specific date/time functions
- Updates AbstractSQLConfig.java:1200-1350
Closes #456
fix(parser): prevent NullPointerException in parseArray()
- Adds null check before calling getJSONArray()
- Location: AbstractParser.java:650-655
- Returns 400 error with descriptive message
Fixes #789
Sources: CONTRIBUTING.md154-157 APIJSONORM/src/main/java/apijson/orm/
For minor documentation or code edits, APIJSON provides a streamlined workflow:
This workflow is ideal for:
Sources: CONTRIBUTING.md103-112
For substantial contributions (new features, refactoring, major bug fixes), follow the full Git workflow:
Alternatively, use the GitHub UI: Contribute → Open pull request on your fork's homepage.
Follow the commit message convention documented in CONTRIBUTING_COMMIT.md Typical format:
type(scope): subject
body (optional)
footer (optional)
Example commit messages:
feat(orm): add support for InfluxDB 2.6+fix(parser): handle null values in @column correctlydocs(readme): update installation instructions for WindowsSources: CONTRIBUTING.md114-157
APIJSON follows structured commit messages for automatic CHANGELOG generation:
| Type | Description | Example |
|---|---|---|
feat | New feature | feat(sql): add SQLite support |
fix | Bug fix | fix(verifier): handle empty Access table |
docs | Documentation | docs(api): add JOIN examples |
style | Code style (formatting) | style: format AbstractParser.java |
refactor | Code refactoring | refactor(executor): simplify SQL generation |
perf | Performance improvement | perf(cache): optimize queryResultMap lookup |
test | Add/update tests | test(parser): add unit tests for parseArray |
chore | Build/tooling changes | chore: update Maven dependencies |
Sources: CONTRIBUTING.md154-157
Pull Requests are reviewed for:
As noted in CONTRIBUTING.md8 maintainers are volunteers with limited time:
"开发者也是人,也需要工作、休息、恋爱、陪伴家人、走亲会友等,也有心情不好和身体病痛,往往没有额外的时间精力顾及一些小问题,请理解和支持"
Translation: "Developers are people too, with work, rest, relationships, and family obligations. Please be understanding and patient with response times."
Response time expectations:
Sources: CONTRIBUTING.md99-102 .github/ISSUE_TEMPLATE/bug_report.yml6-8
APIJSON uses a structured bug report template to ensure issues contain sufficient information for diagnosis and resolution.
The bug report template (.github/ISSUE_TEMPLATE/bug_report.yml) enforces the following required fields:
Specify the exact version from Maven/Gradle dependencies or GitHub release tag. Always test with the latest version first - the project maintains only the most recent release.
Include specific version numbers as behavior varies across database versions.
Example:
- JDK/基础库: OpenJDK 1.8.0_292
- OS/系统: Ubuntu 20.04 LTS (x86_64)
Critical requirement: All bug reports must include complete screenshots from APIAuto showing:
APIAuto performs static validation and often provides fix suggestions, catching many issues before submission.
Detailed description including:
Important notes from .github/ISSUE_TEMPLATE/bug_report.yml55:
Sources: .github/ISSUE_TEMPLATE/bug_report.yml1-84 CONTRIBUTING.md170-181
The GitHub issue template enforces these rules:
As warned in README.md264-266 and Document.md368:
JSON syntax is case-sensitive, comma-sensitive, space-sensitive:
User, not user@column, not @Column or @ column"User[]":{}, not "User []": {}Examples of invalid vs valid requests:
| Invalid ❌ | Valid ✓ | Issue |
|---|---|---|
"user":{} | "User":{} | Table name must be capitalized |
"@Column":"id" | "@column":"id" | Case-sensitive keyword |
"User []":{} | "User[]":{} | No space before [] |
"id": 123 | "id":123 | No space before colon |
Sources: README.md264-266 .github/ISSUE_TEMPLATE/bug_report.yml55
| Component | Path | Lines | Key Methods |
|---|---|---|---|
| Request Parser | APIJSONORM/src/main/java/apijson/orm/AbstractParser.java | ~1800 | parse(), parseResponse(), onObjectParse() |
| Security Validator | APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java | ~1200 | verifyAccess(), verifyRole(), verifyLogin() |
| SQL Generator | APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java | ~2500 | gainSQL(), gainWhereString(), combine() |
| SQL Executor | APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java | ~600 | execute(), executeQuery(), getConnection() |
| Object Parser | APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java | ~800 | parse(), onParse(), setSQLConfig() |
| Demo Config | APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoSQLConfig.java | ~300 | Database-specific overrides |
Sources: APIJSONORM/src/main/java/apijson/orm/ APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/
Import Project:
APIJSON/ root directoryConfigure JDK:
Enable Annotation Processing:
Code Style:
Import Maven Project:
APIJSON/Set JDK:
Maven Update:
Install Extensions:
Open Workspace:
APIJSON/Configure Java:
Sources: README.md56 CONTRIBUTING.md1
APIJSON uses Maven for dependency management and builds. The project structure:
APIJSON/
├── pom.xml (parent POM)
├── APIJSONORM/
│ └── pom.xml (ORM library)
└── APIJSON-Java-Server/
├── APIJSONBoot/
│ └── pom.xml (Spring Boot demo)
└── APIJSONFinal/
└── pom.xml (JFinal demo)
Build Commands:
Verify Installation:
While Maven is the official build tool, some community projects use Gradle:
Sources: APIJSONORM/pom.xml APIJSON-Java-Server/
Key files and their roles:
| File | Purpose | Common Modifications |
|---|---|---|
| DemoApplication.java | Spring Boot entry point | Add beans, configure context |
| DemoController.java | HTTP endpoints (/get, /post, etc.) | Add custom endpoints |
| DemoSQLConfig.java | Database configuration | Override getDBUri(), getDBAccount(), add custom SQL generation |
| DemoParser.java | Request parsing customization | Override onVerifyLogin(), onVerifyRole() |
| DemoVerifier.java | Security rules | Override verifyAccess(), add custom validation |
| application.properties | Spring configuration | Database URL, port, logging |
Example: Adding a custom database:
getDBUri(), getDBAccount(), getDBPassword()Key files: DemoConfig.java (configuration), DemoController.java (routing)
Sources: README.md276-278 APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/
The APIJSON demos support multiple databases. For local testing:
For quick testing without external database:
Sources: README.md19-54
APIJSON uses standard JUnit tests. Test files are located in APIJSONORM/src/test/java/
Note: As of current version, test coverage is limited. Contributing tests is highly encouraged.
APIAuto provides static validation and testing:
Workflow:
Example test case:
What to test:
| Feature | Test Method | Key Classes Involved |
|---|---|---|
| Basic CRUD | GET, POST, PUT, DELETE requests | AbstractParser AbstractSQLExecutor |
| Array queries | "User[]":{"count":10} | AbstractParser |
| JOIN operations | "join":"</User" | AbstractSQLConfig |
| Reference queries | "id@":"/Moment/userId" | AbstractObjectParser |
| Remote functions | "isPraised()":"isContain(...)" | AbstractFunctionParser |
| Access control | Test with different @role values | AbstractVerifier |
| SQL injection | Try malicious input | AbstractVerifier |
Sources: README.md120-159 Document.md69-85 APIJSONORM/src/main/java/apijson/orm/
| Channel | Purpose | Typical Response |
|---|---|---|
| GitHub Issues | Bug reports, feature requests | 1-7 days |
| GitHub Pull Requests | Code contributions | 1-4 weeks for review |
| GitHub Discussions | Questions, ideas | Community-driven |
Contributors are acknowledged in:
Notable contributor categories:
Sources: CONTRIBUTING.md6-78 README.md376-437
APIJSON recognizes significant contributions:
Top contributors as of CONTRIBUTING.md79-84:
| Contributor | Affiliation | Stats | Key Contributions |
|---|---|---|---|
| TommyLemon | Tencent | Project founder | Core architecture, APIJSON-Demo, apijson-framework, apijson-router |
| cloudAndMonkey | - | 11 commits 1,496+ / 845- | Redis, Elasticsearch, Kafka, Lua support; multiple demos |
| justinfengchen | - | 6 commits 3,130+ additions | Major feature additions |
| ruoranw | Los Angeles, USA | 18 commits 328+ / 520- | APIJSONdocs documentation project |
| Zerounary | - | 6 commits 1,104+ additions | APIJSONParser frontend library |
| sunxiaoguang | Zhihu | Core contributions | Infrastructure architecture expertise |
| caohao-go | Tencent | Multiple commits | Former Huawei/Hengsheng/WPS/360 engineer |
APIJSON has received contributions from engineers at:
Contributors are acknowledged in:
Sources: CONTRIBUTING.md6-88 README.md376-437
good first issue or help wantedSources: README.md1-516 CONTRIBUTING.md1-182 Document.md1-25
Refresh this wiki