Skip to content

Commit 9482c91

Browse files
authored
docs: use version placeholders across dependency snippets (#13)
## Summary This PR updates documentation dependency snippets to reduce version maintenance overhead and improve copy-paste safety. Changes included: - Replaced hardcoded dependency versions in docs with placeholders/variables. - Standardized snippet style across Maven, Gradle Kotlin DSL, and Gradle Groovy DSL. - Added Version Catalog (`libs.versions.toml`) examples for both starter and core artifacts. - Added explicit guidance to replace `latest-version` with an actual release version. - Generalized issue template version placeholder to avoid stale fixed examples: - `.github/ISSUE_TEMPLATE/bug_report.yml` Updated files: - `README.md` - `docs/getting-started.md` - `docs/spring-boot-guide.md` - `docs/pure-java-guide.md` - `.github/ISSUE_TEMPLATE/bug_report.yml` ## Related Issues - Closes #12 - Related # ## Change Type - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Test - [ ] Build/CI ## JSON-RPC Impact Describe protocol-level impact, if any: - [x] No protocol behavior change - [ ] Request validation behavior changed - [ ] Error mapping behavior changed - [ ] Method registration/dispatch behavior changed Details: - Documentation-only updates. - No runtime behavior or protocol semantics changed. ## Validation - [ ] `./gradlew test` - [ ] `./gradlew check` - [ ] Added/updated tests for new behavior ## Documentation - [x] Updated README (if needed) - [ ] Added migration notes for breaking changes (if any)
1 parent 8a25fb3 commit 9482c91

5 files changed

Lines changed: 200 additions & 20 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
attributes:
2121
label: Library version
2222
description: Which version are you using?
23-
placeholder: e.g. 0.1.0-SNAPSHOT
23+
placeholder: e.g. <released-version> or <next-version>-SNAPSHOT
2424
validations:
2525
required: true
2626
- type: textarea

README.md

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,50 +37,110 @@ Production-oriented JSON-RPC 2.0 server library for Java, with optional Spring W
3737

3838
### Spring Boot starter
3939

40+
Replace `latest-version` with the release you want to use.
41+
4042
Maven:
4143

4244
```xml
45+
<properties>
46+
<jsonrpc.version>latest-version</jsonrpc.version>
47+
</properties>
48+
4349
<dependency>
4450
<groupId>io.github.limehee</groupId>
4551
<artifactId>jsonrpc-spring-boot-starter</artifactId>
46-
<version>0.1.0</version>
52+
<version>${jsonrpc.version}</version>
4753
</dependency>
4854
```
4955

5056
Gradle (Kotlin DSL):
5157

5258
```kotlin
53-
implementation("io.github.limehee:jsonrpc-spring-boot-starter:0.1.0")
59+
val jsonrpcVersion = "latest-version"
60+
61+
dependencies {
62+
implementation("io.github.limehee:jsonrpc-spring-boot-starter:$jsonrpcVersion")
63+
}
5464
```
5565

5666
Gradle (Groovy DSL):
5767

5868
```groovy
59-
implementation 'io.github.limehee:jsonrpc-spring-boot-starter:0.1.0'
69+
def jsonrpcVersion = "latest-version"
70+
71+
dependencies {
72+
implementation "io.github.limehee:jsonrpc-spring-boot-starter:${jsonrpcVersion}"
73+
}
74+
```
75+
76+
Gradle Version Catalog (`libs.versions.toml`):
77+
78+
```toml
79+
[versions]
80+
jsonrpc = "latest-version"
81+
82+
[libraries]
83+
jsonrpc-spring-boot-starter = { module = "io.github.limehee:jsonrpc-spring-boot-starter", version.ref = "jsonrpc" }
84+
```
85+
86+
```kotlin
87+
dependencies {
88+
implementation(libs.jsonrpc.spring.boot.starter)
89+
}
6090
```
6191

6292
### Core only (pure Java)
6393

94+
Replace `latest-version` with the release you want to use.
95+
6496
Maven:
6597

6698
```xml
99+
<properties>
100+
<jsonrpc.version>latest-version</jsonrpc.version>
101+
</properties>
102+
67103
<dependency>
68104
<groupId>io.github.limehee</groupId>
69105
<artifactId>jsonrpc-core</artifactId>
70-
<version>0.1.0</version>
106+
<version>${jsonrpc.version}</version>
71107
</dependency>
72108
```
73109

74110
Gradle (Kotlin DSL):
75111

76112
```kotlin
77-
implementation("io.github.limehee:jsonrpc-core:0.1.0")
113+
val jsonrpcVersion = "latest-version"
114+
115+
dependencies {
116+
implementation("io.github.limehee:jsonrpc-core:$jsonrpcVersion")
117+
}
78118
```
79119

80120
Gradle (Groovy DSL):
81121

82122
```groovy
83-
implementation 'io.github.limehee:jsonrpc-core:0.1.0'
123+
def jsonrpcVersion = "latest-version"
124+
125+
dependencies {
126+
implementation "io.github.limehee:jsonrpc-core:${jsonrpcVersion}"
127+
}
128+
```
129+
130+
Gradle Version Catalog (`libs.versions.toml`):
131+
132+
```toml
133+
[versions]
134+
jsonrpc = "latest-version"
135+
136+
[libraries]
137+
jsonrpc-core = { module = "io.github.limehee:jsonrpc-core", version.ref = "jsonrpc" }
138+
```
139+
140+
```kotlin
141+
dependencies {
142+
implementation(libs.jsonrpc.core)
143+
}
84144
```
85145

86146
## Quick Start (Spring Boot)

docs/getting-started.md

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,110 @@ This guide gets a working JSON-RPC endpoint up quickly and provides the shortest
1717

1818
### 3.1 Spring Boot starter
1919

20+
Replace `latest-version` with the release you want to use.
21+
2022
Maven:
2123

2224
```xml
25+
<properties>
26+
<jsonrpc.version>latest-version</jsonrpc.version>
27+
</properties>
28+
2329
<dependency>
2430
<groupId>io.github.limehee</groupId>
2531
<artifactId>jsonrpc-spring-boot-starter</artifactId>
26-
<version>0.1.0</version>
32+
<version>${jsonrpc.version}</version>
2733
</dependency>
2834
```
2935

3036
Gradle (Kotlin DSL):
3137

3238
```kotlin
33-
implementation("io.github.limehee:jsonrpc-spring-boot-starter:0.1.0")
39+
val jsonrpcVersion = "latest-version"
40+
41+
dependencies {
42+
implementation("io.github.limehee:jsonrpc-spring-boot-starter:$jsonrpcVersion")
43+
}
3444
```
3545

3646
Gradle (Groovy DSL):
3747

3848
```groovy
39-
implementation 'io.github.limehee:jsonrpc-spring-boot-starter:0.1.0'
49+
def jsonrpcVersion = "latest-version"
50+
51+
dependencies {
52+
implementation "io.github.limehee:jsonrpc-spring-boot-starter:${jsonrpcVersion}"
53+
}
54+
```
55+
56+
Gradle Version Catalog (`libs.versions.toml`):
57+
58+
```toml
59+
[versions]
60+
jsonrpc = "latest-version"
61+
62+
[libraries]
63+
jsonrpc-spring-boot-starter = { module = "io.github.limehee:jsonrpc-spring-boot-starter", version.ref = "jsonrpc" }
64+
```
65+
66+
```kotlin
67+
dependencies {
68+
implementation(libs.jsonrpc.spring.boot.starter)
69+
}
4070
```
4171

4272
### 3.2 Core only (pure Java)
4373

74+
Replace `latest-version` with the release you want to use.
75+
4476
Maven:
4577

4678
```xml
79+
<properties>
80+
<jsonrpc.version>latest-version</jsonrpc.version>
81+
</properties>
82+
4783
<dependency>
4884
<groupId>io.github.limehee</groupId>
4985
<artifactId>jsonrpc-core</artifactId>
50-
<version>0.1.0</version>
86+
<version>${jsonrpc.version}</version>
5187
</dependency>
5288
```
5389

5490
Gradle (Kotlin DSL):
5591

5692
```kotlin
57-
implementation("io.github.limehee:jsonrpc-core:0.1.0")
93+
val jsonrpcVersion = "latest-version"
94+
95+
dependencies {
96+
implementation("io.github.limehee:jsonrpc-core:$jsonrpcVersion")
97+
}
5898
```
5999

60100
Gradle (Groovy DSL):
61101

62102
```groovy
63-
implementation 'io.github.limehee:jsonrpc-core:0.1.0'
103+
def jsonrpcVersion = "latest-version"
104+
105+
dependencies {
106+
implementation "io.github.limehee:jsonrpc-core:${jsonrpcVersion}"
107+
}
108+
```
109+
110+
Gradle Version Catalog (`libs.versions.toml`):
111+
112+
```toml
113+
[versions]
114+
jsonrpc = "latest-version"
115+
116+
[libraries]
117+
jsonrpc-core = { module = "io.github.limehee:jsonrpc-core", version.ref = "jsonrpc" }
118+
```
119+
120+
```kotlin
121+
dependencies {
122+
implementation(libs.jsonrpc.core)
123+
}
64124
```
65125

66126
## 4. Spring Boot Minimal Example

docs/pure-java-guide.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,56 @@
44

55
## 1. Dependency
66

7+
Replace `latest-version` with the release you want to use.
8+
79
Maven:
810

911
```xml
12+
<properties>
13+
<jsonrpc.version>latest-version</jsonrpc.version>
14+
</properties>
15+
1016
<dependency>
1117
<groupId>io.github.limehee</groupId>
1218
<artifactId>jsonrpc-core</artifactId>
13-
<version>0.1.0</version>
19+
<version>${jsonrpc.version}</version>
1420
</dependency>
1521
```
1622

1723
Gradle (Kotlin DSL):
1824

1925
```kotlin
20-
implementation("io.github.limehee:jsonrpc-core:0.1.0")
26+
val jsonrpcVersion = "latest-version"
27+
28+
dependencies {
29+
implementation("io.github.limehee:jsonrpc-core:$jsonrpcVersion")
30+
}
2131
```
2232

2333
Gradle (Groovy DSL):
2434

2535
```groovy
26-
implementation 'io.github.limehee:jsonrpc-core:0.1.0'
36+
def jsonrpcVersion = "latest-version"
37+
38+
dependencies {
39+
implementation "io.github.limehee:jsonrpc-core:${jsonrpcVersion}"
40+
}
41+
```
42+
43+
Gradle Version Catalog (`libs.versions.toml`):
44+
45+
```toml
46+
[versions]
47+
jsonrpc = "latest-version"
48+
49+
[libraries]
50+
jsonrpc-core = { module = "io.github.limehee:jsonrpc-core", version.ref = "jsonrpc" }
51+
```
52+
53+
```kotlin
54+
dependencies {
55+
implementation(libs.jsonrpc.core)
56+
}
2757
```
2858

2959
## 2. Minimal Dispatcher
@@ -110,7 +140,7 @@ dispatcher.register(
110140
```java
111141
dispatcher.register(
112142
"health",
113-
factory.noParams(() -> Map.of("status", "UP", "version", "0.1.0"))
143+
factory.noParams(() -> Map.of("status", "UP", "version", "1.0.0"))
114144
);
115145
```
116146

docs/spring-boot-guide.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,56 @@ This guide covers production-style Spring Boot usage, including registration str
44

55
## 1. Dependency
66

7+
Replace `latest-version` with the release you want to use.
8+
79
Maven:
810

911
```xml
12+
<properties>
13+
<jsonrpc.version>latest-version</jsonrpc.version>
14+
</properties>
15+
1016
<dependency>
1117
<groupId>io.github.limehee</groupId>
1218
<artifactId>jsonrpc-spring-boot-starter</artifactId>
13-
<version>0.1.0</version>
19+
<version>${jsonrpc.version}</version>
1420
</dependency>
1521
```
1622

1723
Gradle (Kotlin DSL):
1824

1925
```kotlin
20-
implementation("io.github.limehee:jsonrpc-spring-boot-starter:0.1.0")
26+
val jsonrpcVersion = "latest-version"
27+
28+
dependencies {
29+
implementation("io.github.limehee:jsonrpc-spring-boot-starter:$jsonrpcVersion")
30+
}
2131
```
2232

2333
Gradle (Groovy DSL):
2434

2535
```groovy
26-
implementation 'io.github.limehee:jsonrpc-spring-boot-starter:0.1.0'
36+
def jsonrpcVersion = "latest-version"
37+
38+
dependencies {
39+
implementation "io.github.limehee:jsonrpc-spring-boot-starter:${jsonrpcVersion}"
40+
}
41+
```
42+
43+
Gradle Version Catalog (`libs.versions.toml`):
44+
45+
```toml
46+
[versions]
47+
jsonrpc = "latest-version"
48+
49+
[libraries]
50+
jsonrpc-spring-boot-starter = { module = "io.github.limehee:jsonrpc-spring-boot-starter", version.ref = "jsonrpc" }
51+
```
52+
53+
```kotlin
54+
dependencies {
55+
implementation(libs.jsonrpc.spring.boot.starter)
56+
}
2757
```
2858

2959
## 2. Endpoint Exposure

0 commit comments

Comments
 (0)