Skip to content

Commit b5dc864

Browse files
committed
Updates for Peer OpenAPI generation
1 parent f057ab2 commit b5dc864

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

convex-restapi/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
</annotationProcessorPath>
3434
</annotationProcessorPaths>
3535
</configuration>
36+
<!--
3637
<executions>
3738
<execution>
3839
<id>default-compile</id>
@@ -41,6 +42,18 @@
4142
</goals>
4243
</execution>
4344
</executions>
45+
-->
46+
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
<configuration>
51+
<excludes>
52+
<!--
53+
<exclude>openapi-plugin/**</exclude>>
54+
-->
55+
</excludes>
56+
</configuration>
4457
</plugin>
4558
</plugins>
4659
</build>

convex-restapi/src/main/java/convex/restapi/RESTServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected SslPlugin getSSLPlugin(HashMap<Keyword, Object> config) {
148148
}
149149

150150
protected void addOpenApiPlugins(JavalinConfig config) {
151-
String docsPath="openapi-plugin/openapi-default.json";
151+
String docsPath="openapi-plugin/openapi-restapi.json";
152152

153153
config.registerPlugin(new OpenApiPlugin(pluginConfig -> {
154154
pluginConfig

convex-restapi/src/main/java/convex/restapi/WebApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private void indexPage(Context ctx) {
3939
p("Version: "+Utils.getVersion()),
4040
p(a("Explorer").withHref("explorer")),
4141

42-
p("This is the default web page for a Convex Peer Server running the REST API")
42+
p("This is the web page for a Convex Peer Server running the REST API")
4343
)
4444
);
4545
ctx.result(content.render());

convex-restapi/src/main/java/convex/restapi/api/ChainAPI.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public void addRoutes(Javalin app) {
100100
}
101101

102102
@OpenApi(path = ROUTE + "data/{hash}",
103+
versions="peer-v1",
103104
methods = HttpMethod.POST,
104105
tags = { "Data Lattice"},
105106
summary = "Get data from the server with the specified hash",
@@ -131,10 +132,11 @@ public void getData(Context ctx) {
131132
}
132133

133134
@OpenApi(path = ROUTE + "createAccount",
135+
versions="peer-v1",
134136
methods = HttpMethod.POST,
135137
operationId = "createAccount",
136138
tags = { "Account"},
137-
summary = "Create a new Convex account. Requires a peer winning to accept faucet requests.",
139+
summary = "Create a new Convex account. Requires a peer willing to accept faucet requests.",
138140
requestBody = @OpenApiRequestBody(
139141
description = "Create Account request, must provide an accountKey for the new Account",
140142
content = {@OpenApiContent(
@@ -184,6 +186,7 @@ public void createAccount(Context ctx) throws InterruptedException {
184186
}
185187

186188
@OpenApi(path = ROUTE + "accounts/{address}",
189+
versions="peer-v1",
187190
methods = HttpMethod.GET,
188191
operationId = "queryAccount",
189192
tags = { "Account"},
@@ -273,6 +276,7 @@ public void queryPeer(Context ctx) throws InterruptedException {
273276
private static Keyword K_FAUCET=Keyword.create("faucet");
274277

275278
@OpenApi(path = ROUTE + "faucet",
279+
versions="peer-v1",
276280
methods = HttpMethod.POST,
277281
operationId = "faucetRequest",
278282
tags = { "Account"},
@@ -363,6 +367,7 @@ private boolean isFaucetEnabled() {
363367
}
364368

365369
@OpenApi(path = ROUTE+"transaction/prepare",
370+
versions="peer-v1",
366371
methods = HttpMethod.POST,
367372
operationId = "transactionPrepare",
368373
tags= {"Transactions"},
@@ -433,6 +438,7 @@ public void transactionPrepare(Context ctx) throws InterruptedException, IOExcep
433438

434439
@SuppressWarnings("unchecked")
435440
@OpenApi(path = ROUTE+"transact",
441+
versions="peer-v1",
436442
methods = HttpMethod.POST,
437443
operationId = "transact",
438444
tags= {"Transactions"},
@@ -540,6 +546,7 @@ private static ACell readCode(Object srcValue) {
540546
}
541547

542548
@OpenApi(path = ROUTE+"transaction/submit",
549+
versions="peer-v1",
543550
methods = HttpMethod.POST,
544551
operationId = "transactionSubmit",
545552
tags= {"Transactions"},
@@ -618,6 +625,7 @@ public void transactionSubmit(Context ctx) throws InterruptedException {
618625
}
619626

620627
@OpenApi(path = ROUTE+"query",
628+
versions="peer-v1",
621629
methods = HttpMethod.POST,
622630
operationId = "query",
623631
tags= {"Transactions"},

convex-restapi/src/main/java/convex/restapi/api/PeerAdminAPI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void addRoutes(Javalin app) {
3838
}
3939

4040
@OpenApi(path = ROUTE + "peer/shutdown",
41+
versions="peer-v1",
4142
methods = HttpMethod.POST,
4243
operationId = "shutdownPeer",
4344
tags = { "Admin"},

0 commit comments

Comments
 (0)