diff --git a/http-service/pom.xml b/http-service/pom.xml index b63c8f77e4..eba29dfe40 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -180,6 +180,48 @@ spring-boot-maven-plugin ${spring.boot.version} + + com.github.kongchen + swagger-maven-plugin + 3.1.8 + + + + true + + net.runelite + + + https + + api.runelite.net + /runelite-${project.version} + + ${project.parent.name} HTTP API + ${project.version} + ${project.description} + + https://tldrlegal.com/license/bsd-2-clause-license-(freebsd) + BSD 2-Clause "Simplified" + + + ${basedir}/src/main/templates/template.html.hbs + ${project.build.directory}/swagger-ui + ${project.build.directory}/site/api.html + true + json + + + + + + compile + + generate + + + + diff --git a/http-service/src/main/java/net/runelite/http/service/account/AccountService.java b/http-service/src/main/java/net/runelite/http/service/account/AccountService.java index fbc2fbf379..8cc83d2d80 100644 --- a/http-service/src/main/java/net/runelite/http/service/account/AccountService.java +++ b/http-service/src/main/java/net/runelite/http/service/account/AccountService.java @@ -52,6 +52,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -135,7 +136,7 @@ public class AccountService } } - @RequestMapping("/login") + @GetMapping("/login") public OAuthResponse login(@RequestParam UUID uuid) { State state = new State(); @@ -162,7 +163,7 @@ public class AccountService return lr; } - @RequestMapping("/callback") + @GetMapping("/callback") public Object callback( HttpServletRequest request, HttpServletResponse response, @@ -250,7 +251,7 @@ public class AccountService } } - @RequestMapping("/logout") + @GetMapping("/logout") public void logout(HttpServletRequest request, HttpServletResponse response) throws IOException { SessionEntry session = auth.handle(request, response); @@ -268,7 +269,7 @@ public class AccountService } } - @RequestMapping("/session-check") + @GetMapping("/session-check") public void sessionCheck(HttpServletRequest request, HttpServletResponse response) throws IOException { auth.handle(request, response); diff --git a/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java b/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java index 9e4c0ab0bb..f86f453412 100644 --- a/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java +++ b/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java @@ -62,6 +62,7 @@ import net.runelite.http.service.cache.beans.IndexEntry; import net.runelite.http.service.util.exception.NotFoundException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -75,7 +76,7 @@ public class CacheController @Autowired private CacheService cacheService; - @RequestMapping("/") + @GetMapping("/") public List listCaches() { return cacheService.listCaches().stream() @@ -83,7 +84,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}") + @GetMapping("{cacheId}") public List listIndexes(@PathVariable int cacheId) { CacheEntry cache = cacheService.findCache(cacheId); @@ -99,7 +100,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}/{indexId}") + @GetMapping("{cacheId}/{indexId}") public List listArchives(@PathVariable int cacheId, @PathVariable int indexId) { @@ -122,7 +123,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}/{indexId}/{archiveId}") + @GetMapping("{cacheId}/{indexId}/{archiveId}") public CacheArchive getCacheArchive(@PathVariable int cacheId, @PathVariable int indexId, @PathVariable int archiveId) @@ -149,7 +150,7 @@ public class CacheController archiveEntry.getNameHash(), archiveEntry.getRevision()); } - @RequestMapping("{cacheId}/{indexId}/{archiveId}/data") + @GetMapping("{cacheId}/{indexId}/{archiveId}/data") public byte[] getArchiveData( @PathVariable int cacheId, @PathVariable int indexId, @@ -200,7 +201,7 @@ public class CacheController return archiveEntry; } - @RequestMapping("item/{itemId}") + @GetMapping("item/{itemId}") public ItemDefinition getItem(@PathVariable int itemId) throws IOException { ArchiveEntry archiveEntry = findConfig(ConfigType.ITEM); @@ -221,7 +222,7 @@ public class CacheController return itemdef; } - @RequestMapping(path = "item/{itemId}/image", produces = "image/png") + @GetMapping(path = "item/{itemId}/image", produces = "image/png") public ResponseEntity getItemImage( @PathVariable int itemId, @RequestParam(defaultValue = "1") int quantity, @@ -313,7 +314,7 @@ public class CacheController return ResponseEntity.ok(bao.toByteArray()); } - @RequestMapping("object/{objectId}") + @GetMapping("object/{objectId}") public ObjectDefinition getObject( @PathVariable int objectId ) throws IOException @@ -336,7 +337,7 @@ public class CacheController return objectdef; } - @RequestMapping("npc/{npcId}") + @GetMapping("npc/{npcId}") public NpcDefinition getNpc( @PathVariable int npcId ) throws IOException diff --git a/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java b/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java index 966d49cda2..b14a03659c 100644 --- a/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java +++ b/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java @@ -31,6 +31,7 @@ import net.runelite.http.api.config.Configuration; import net.runelite.http.service.account.AuthFilter; import net.runelite.http.service.account.beans.SessionEntry; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -52,7 +53,7 @@ public class ConfigController this.authFilter = authFilter; } - @RequestMapping + @GetMapping public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException { SessionEntry session = authFilter.handle(request, response); diff --git a/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java b/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java index c689172e9b..b7e079497f 100644 --- a/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java +++ b/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java @@ -30,6 +30,7 @@ import static net.runelite.http.service.examine.ExamineType.OBJECT; import net.runelite.http.service.item.ItemEntry; import net.runelite.http.service.item.ItemService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,19 +51,19 @@ public class ExamineController this.itemService = itemService; } - @RequestMapping("/npc/{id}") + @GetMapping("/npc/{id}") public String getNpc(@PathVariable int id) { return examineService.get(NPC, id); } - @RequestMapping("/object/{id}") + @GetMapping("/object/{id}") public String getObject(@PathVariable int id) { return examineService.get(OBJECT, id); } - @RequestMapping("/item/{id}") + @GetMapping("/item/{id}") public String getItem(@PathVariable int id) { // Tradeable item examine info is available from the Jagex item API diff --git a/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java b/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java index fa641d3714..c679cd319f 100644 --- a/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java +++ b/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java @@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -95,7 +96,7 @@ public class FeedController feedResult = new FeedResult(items); } - @RequestMapping + @GetMapping public ResponseEntity getFeed() { if (feedResult == null) diff --git a/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java b/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java index d144b7db79..25a89e6a8d 100644 --- a/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java +++ b/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java @@ -34,6 +34,7 @@ import net.runelite.http.service.util.HiscoreEndpointEditor; import net.runelite.http.service.xp.XpTrackerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,7 +51,7 @@ public class HiscoreController @Autowired private XpTrackerService xpTrackerService; - @RequestMapping("/{endpoint}") + @GetMapping("/{endpoint}") public HiscoreResult lookup(@PathVariable HiscoreEndpoint endpoint, @RequestParam String username) throws ExecutionException { HiscoreResult result = hiscoreService.lookupUsername(username, endpoint); @@ -68,7 +69,7 @@ public class HiscoreController return result; } - @RequestMapping("/{endpoint}/{skillName}") + @GetMapping("/{endpoint}/{skillName}") public SingleHiscoreSkillResult singleSkillLookup(@PathVariable HiscoreEndpoint endpoint, @PathVariable String skillName, @RequestParam String username) throws ExecutionException { HiscoreSkill skill = HiscoreSkill.valueOf(skillName.toUpperCase()); diff --git a/http-service/src/main/java/net/runelite/http/service/item/ItemController.java b/http-service/src/main/java/net/runelite/http/service/item/ItemController.java index 9c05889330..9d1ed5710e 100644 --- a/http-service/src/main/java/net/runelite/http/service/item/ItemController.java +++ b/http-service/src/main/java/net/runelite/http/service/item/ItemController.java @@ -40,6 +40,7 @@ import net.runelite.http.api.item.SearchResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -78,7 +79,7 @@ public class ItemController .toArray(ItemPrice[]::new), 30, TimeUnit.MINUTES); } - @RequestMapping("/{itemId}") + @GetMapping("/{itemId}") public Item getItem(HttpServletResponse response, @PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -91,7 +92,7 @@ public class ItemController return null; } - @RequestMapping(path = "/{itemId}/icon", produces = "image/gif") + @GetMapping(path = "/{itemId}/icon", produces = "image/gif") public ResponseEntity getIcon(@PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -104,7 +105,7 @@ public class ItemController return ResponseEntity.notFound().build(); } - @RequestMapping(path = "/{itemId}/icon/large", produces = "image/gif") + @GetMapping(path = "/{itemId}/icon/large", produces = "image/gif") public ResponseEntity getIconLarge(HttpServletResponse response, @PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -117,7 +118,7 @@ public class ItemController return ResponseEntity.notFound().build(); } - @RequestMapping("/{itemId}/price") + @GetMapping("/{itemId}/price") public ResponseEntity itemPrice( @PathVariable int itemId, @RequestParam(required = false) Instant time @@ -179,7 +180,7 @@ public class ItemController .body(itemPrice); } - @RequestMapping("/search") + @GetMapping("/search") public SearchResult search(@RequestParam String query) { List result = itemService.search(query); @@ -193,7 +194,7 @@ public class ItemController return searchResult; } - @RequestMapping("/price") + @GetMapping("/price") public ItemPrice[] prices(@RequestParam("id") int[] itemIds) { if (itemIds.length > MAX_BATCH_LOOKUP) @@ -216,7 +217,7 @@ public class ItemController .toArray(ItemPrice[]::new); } - @RequestMapping("/prices") + @GetMapping("/prices") public ResponseEntity prices() { return ResponseEntity.ok() diff --git a/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java b/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java index d5a09f44d2..2c1bd77140 100644 --- a/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java +++ b/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java @@ -35,6 +35,7 @@ import net.runelite.http.service.account.AuthFilter; import net.runelite.http.service.account.beans.SessionEntry; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -65,7 +66,7 @@ public class LootTrackerController response.setStatus(HttpStatusCodes.STATUS_CODE_OK); } - @RequestMapping + @GetMapping public Collection getLootRecords(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start) throws IOException { SessionEntry e = auth.handle(request, response); diff --git a/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java b/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java index 847c415772..eaade27c12 100644 --- a/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java +++ b/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -45,7 +46,7 @@ public class OSBGrandExchangeController this.grandExchangeService = grandExchangeService; } - @RequestMapping + @GetMapping public ResponseEntity get(@RequestParam("itemId") int itemId) throws ExecutionException { GrandExchangeEntry grandExchangeEntry = grandExchangeService.get(itemId); diff --git a/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java b/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java index 42b285761e..80d8f738ba 100644 --- a/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java +++ b/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -55,7 +56,7 @@ public class SpriteController } }); - @RequestMapping(produces = "image/png") + @GetMapping(produces = "image/png") public ResponseEntity getSprite( @RequestParam int spriteId, @RequestParam(defaultValue = "0") int frameId diff --git a/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java b/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java index 7dba1bc1dd..51769e181c 100644 --- a/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java +++ b/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java @@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -45,7 +46,7 @@ public class WorldController private WorldResult worldResult; - @RequestMapping + @GetMapping public ResponseEntity listWorlds() throws IOException { return ResponseEntity.ok() diff --git a/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java b/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java index 9710faef20..d247d735a4 100644 --- a/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java +++ b/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java @@ -28,6 +28,7 @@ import java.time.Instant; import net.runelite.http.api.xp.XpData; import net.runelite.http.service.xp.beans.XpEntity; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -39,13 +40,13 @@ public class XpTrackerController @Autowired private XpTrackerService xpTrackerService; - @RequestMapping("/update") + @GetMapping("/update") public void update(@RequestParam String username) { xpTrackerService.tryUpdate(username); } - @RequestMapping("/get") + @GetMapping("/get") public XpData get(@RequestParam String username, @RequestParam(required = false) Instant time) { if (time == null) diff --git a/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java b/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java index 5f06429a80..3868acb8c6 100644 --- a/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java +++ b/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java @@ -30,6 +30,7 @@ import net.runelite.http.api.xtea.XteaKey; import net.runelite.http.api.xtea.XteaRequest; import net.runelite.http.service.util.exception.NotFoundException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -49,7 +50,7 @@ public class XteaController xteaService.submit(xteaRequest); } - @RequestMapping + @GetMapping public List get() { return xteaService.get().stream() @@ -57,7 +58,7 @@ public class XteaController .collect(Collectors.toList()); } - @RequestMapping("/{region}") + @GetMapping("/{region}") public XteaKey getRegion(@PathVariable int region) { XteaEntry xteaRegion = xteaService.getRegion(region); diff --git a/http-service/src/main/templates/markdown.hbs b/http-service/src/main/templates/markdown.hbs new file mode 100644 index 0000000000..1beacd052a --- /dev/null +++ b/http-service/src/main/templates/markdown.hbs @@ -0,0 +1,110 @@ +{{#info}} +# {{title}} +{{join schemes " | "}}://{{host}}{{basePath}} + +{{description}} + +{{#contact}} +[**Contact the developer**](mailto:{{email}}) +{{/contact}} + +**Version** {{version}} + +{{#if termsOfService}} +[**Terms of Service**]({{termsOfService}}) +{{/if}} + +{{/info}} + +{{#if consumes}}__Consumes:__ {{join consumes ", "}}{{/if}} + +{{#if produces}}__Produces:__ {{join produces ", "}}{{/if}} + +{{#if securityDefinitions}} +# Security Definitions +{{> security}} +{{/if}} + +
+Table Of Contents +[toc] +
+ +# APIs + +{{#each paths}} +## {{@key}} +{{#this}} +{{#get}} +### GET +{{> operation}} +{{/get}} + +{{#put}} +### PUT +{{> operation}} +{{/put}} + +{{#post}} +### POST + +{{> operation}} + +{{/post}} + +{{#delete}} +### DELETE +{{> operation}} +{{/delete}} + +{{#option}} +### OPTION +{{> operation}} +{{/option}} + +{{#patch}} +### PATCH +{{> operation}} +{{/patch}} + +{{#head}} +### HEAD +{{> operation}} +{{/head}} + +{{/this}} +{{/each}} + +# Definitions +{{#each definitions}} +## {{@key}} + + + + + + + + + + {{#each this.properties}} + + + + + + + + {{/each}} +
nametyperequireddescriptionexample
{{@key}} + {{#ifeq type "array"}} + {{#items.$ref}} + {{type}}[{{basename items.$ref}}] + {{/items.$ref}} + {{^items.$ref}}{{type}}[{{items.type}}]{{/items.$ref}} + {{else}} + {{#$ref}}{{basename $ref}}{{/$ref}} + {{^$ref}}{{type}}{{#format}} ({{format}}){{/format}}{{/$ref}} + {{/ifeq}} + {{#required}}required{{/required}}{{^required}}optional{{/required}}{{#description}}{{{description}}}{{/description}}{{^description}}-{{/description}}{{example}}
+{{/each}} diff --git a/http-service/src/main/templates/operation.hbs b/http-service/src/main/templates/operation.hbs new file mode 100644 index 0000000000..f7015850b8 --- /dev/null +++ b/http-service/src/main/templates/operation.hbs @@ -0,0 +1,71 @@ +{{#deprecated}}-deprecated-{{/deprecated}} +{{summary}} + +{{description}} + +{{#if externalDocs.url}}{{externalDocs.description}}. [See external documents for more details]({{externalDocs.url}}) +{{/if}} + +{{#if security}} +#### Security +{{/if}} + +{{#security}} +{{#each this}} +* {{@key}} +{{#this}} * {{this}} +{{/this}} +{{/each}} +{{/security}} + +#### Request + +{{#if consumes}}__Content-Type:__ {{join consumes ", "}}{{/if}} + +##### Parameters +{{#if parameters}} + + + + + + + + + +{{/if}} + +{{#parameters}} + + + + + + +{{#ifeq in "body"}} + +{{else}} + {{#ifeq type "array"}} + + {{else}} + + {{/ifeq}} +{{/ifeq}} + +{{/parameters}} +{{#if parameters}} +
NameLocated inRequiredDescriptionDefaultSchema
{{name}}{{in}}{{#if required}}yes{{else}}no{{/if}}{{description}}{{#if pattern}} (**Pattern**: `{{pattern}}`){{/if}} - + {{#ifeq schema.type "array"}}Array[{{basename schema.items.$ref}}]{{/ifeq}} + {{#schema.$ref}}{{basename schema.$ref}} {{/schema.$ref}} + Array[{{items.type}}] ({{collectionFormat}}){{type}} {{#format}}({{format}}){{/format}}
+{{/if}} + + +#### Response + +{{#if produces}}__Content-Type:__ {{join produces ", "}}{{/if}} + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +{{#each responses}}| {{@key}} | {{description}} | {{#schema.$ref}}{{basename schema.$ref}}{{/schema.$ref}}{{#ifeq schema.type "array"}}Array[{{basename schema.items.$ref}}]{{/ifeq}}{{^schema}} - {{/schema}}| +{{/each}} diff --git a/http-service/src/main/templates/security.hbs b/http-service/src/main/templates/security.hbs new file mode 100644 index 0000000000..04f86e8380 --- /dev/null +++ b/http-service/src/main/templates/security.hbs @@ -0,0 +1,88 @@ +{{#each securityDefinitions}} +### {{@key}} +{{#this}} +{{#ifeq type "oauth2"}} + + + + + +{{#if description}} + + + + +{{/if}} +{{#if authorizationUrl}} + + + + +{{/if}} +{{#if flow}} + + + + +{{/if}} +{{#if tokenUrl}} + + + + +{{/if}} +{{#if scopes}} + + +{{#each scopes}} + + + + +{{/each}} + +{{/if}} +
type{{type}}
description{{description}}
authorizationUrl{{authorizationUrl}}
flow{{flow}}
tokenUrl{{tokenUrl}}
scopes{{@key}}{{this}}
+{{/ifeq}} +{{#ifeq type "apiKey"}} + + + + + +{{#if description}} + + + + +{{/if}} +{{#if name}} + + + + +{{/if}} +{{#if in}} + + + + +{{/if}} +
type{{type}}
description{{description}}
name{{name}}
in{{in}}
+{{/ifeq}} +{{#ifeq type "basic"}} + + + + + +{{#if description}} + + + + +{{/if}} +
type{{type}}
description{{description}}
+{{/ifeq}} +{{/this}} +{{/each}} \ No newline at end of file diff --git a/http-service/src/main/templates/template.html.hbs b/http-service/src/main/templates/template.html.hbs new file mode 100644 index 0000000000..da587c2cc4 --- /dev/null +++ b/http-service/src/main/templates/template.html.hbs @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + {{info.title}} {{info.version}} + + + + + \ No newline at end of file