Skip to content

Commit

Permalink
Added Swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentIO committed May 3, 2024
1 parent 14c28b1 commit 62c409c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export default defineConfig({
{
text: 'Hardware Registration and Configuration Firmware',
link: 'https://github.com/BrentIO/FireFly-Controller/tree/main/Hardware-Registration-and-Configuration'
{
text: 'API Reference',
link: '/controller/software/hardware_registration_and_configuration/api_reference'
},
},
{ text: 'Controller Firmware',
link: 'https://github.com/BrentIO/FireFly-Controller/tree/main/Controller'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup>
import SwaggerUIBundle from './api_reference.vue'
</script>

# API Reference
The Swagger documentation below is rendered from the most recent version available on GitHub. You should verify the version shown matches the firmware version on your device.

A Visual Token can be found on the [OLED screen](/controller/support/OLED_screens/#auth-token), which randomizes the code. Once authorized, the token is usually valid for 1 hour.

> [!NOTE]
> This page is best viewed in `light` mode.
<SwaggerUIBundle />
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script setup lang="ts">
import { onMounted } from "vue";
import { SwaggerUIBundle } from "swagger-ui-dist";
import "swagger-ui-dist/swagger-ui.css";
onMounted(() => {
SwaggerUIBundle({
dom_id: "#swaggerContainer",
url: "https://raw.githubusercontent.com/BrentIO/FireFly-Controller/main/Hardware-Registration-and-Configuration/swagger.yaml"
});
});
</script>

<template>
<div class="swagger" id="swaggerContainer" />
</template>
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
},
"devDependencies": {
"vitepress": "^1.0.1"
},
"dependencies": {
"swagger-ui-dist": "^5.17.2"
}
}
}

0 comments on commit 62c409c

Please sign in to comment.