Skip to content

Commit

Permalink
feature: added open api merger (#19)
Browse files Browse the repository at this point in the history
* feature: added open api merger

* feat: create swagger html and serve it

* feat: added api version to merged openapi

* chore: sync openapi specs🔄

* chore: updated openapi.yaml

* fix: changed endpoint doc to docs

* fix: open api generation and serving fixes
  • Loading branch information
adrrf authored Nov 20, 2024
1 parent bc6b994 commit 6201a4a
Show file tree
Hide file tree
Showing 10 changed files with 1,787 additions and 9 deletions.
42 changes: 42 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ kafka = "=0.10.0"
serde_json = "=1.0.133"
chrono = "=0.4.38"
uuid = { version = "=1.11.0", features = [ "v4" ] }
openapiv3 = "=2.0.0"
walkdir = "=2.5.0"
iptools = "=0.3.0"
3 changes: 3 additions & 0 deletions config.yaml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
api_gateway_url: "0.0.0.0:8080"
is_https: false
authorization_api_url: "http://localhost:3001/auth/api/v1/validate"
services:
- path: "/auth/api/v1"
Expand All @@ -15,3 +16,5 @@ logger_config:
out_file: "logs/out.log"
err_file: "logs/err.log"
debug_file: "logs/debug.log"
docs_path: "./docs"
openapi_path: "./openapi.yaml"
3 changes: 2 additions & 1 deletion docs/.last_updated
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Tue Nov 19 22:37:14 UTC 2024
Wed Nov 20 16:09:42 UTC 2024

28 changes: 28 additions & 0 deletions openapi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui-bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui-standalone-preset.js"></script>
</head>
<body>
<div id="swagger-ui"></div>
<script>
const ui = SwaggerUIBundle({
url: 'http://0.0.0.0:8080/docs/openapi.yaml', // Use self.url to dynamically insert the URL
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
layout: "BaseLayout"
});
</script>
</body>
</html>

Loading

0 comments on commit 6201a4a

Please sign in to comment.