Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 35af5c0

Browse files
committed
OpenAPI JSON and YAML per dynamic entity 2
1 parent 401b720 commit 35af5c0

4 files changed

Lines changed: 54 additions & 2 deletions

File tree

src/routes/(protected)/dynamic-entities/system/openapi-json/+page.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export const load: PageServerLoad = async ({ locals, url }) => {
6161

6262
return {
6363
openApiJson,
64+
tags: tags || null,
65+
characterCount: openApiJson.length,
66+
apiUrl: apiUrl,
6467
};
6568
} catch (err) {
6669
logger.error("Error fetching OpenAPI JSON:", err);

src/routes/(protected)/dynamic-entities/system/openapi-json/+page.svelte

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<script lang="ts">
22
import type { PageData } from "./$types";
33
4-
let { data }: { data: PageData } = $props();
4+
let {
5+
data,
6+
}: {
7+
data: PageData & {
8+
tags?: string | null;
9+
characterCount?: number;
10+
apiUrl?: string;
11+
};
12+
} = $props();
513
614
let copied = $state(false);
715
@@ -33,6 +41,21 @@
3341
<p class="mt-1 text-gray-600 dark:text-gray-400">
3442
OpenAPI specification for dynamic entity endpoints
3543
</p>
44+
{#if data.tags}
45+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
46+
<span class="font-semibold">Tag:</span>
47+
{data.tags}
48+
</p>
49+
{/if}
50+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
51+
<span class="font-semibold">Character count:</span>
52+
{data.characterCount?.toLocaleString()}
53+
</p>
54+
{#if data.apiUrl}
55+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-500 font-mono">
56+
API: {data.apiUrl}
57+
</p>
58+
{/if}
3659
</div>
3760
<div class="flex gap-2">
3861
<a

src/routes/(protected)/dynamic-entities/system/openapi-yaml/+page.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export const load: PageServerLoad = async ({ locals, url }) => {
5050

5151
return {
5252
openApiYaml,
53+
tags: tags || null,
54+
characterCount: openApiYaml.length,
55+
apiUrl: apiUrl,
5356
};
5457
} catch (err) {
5558
logger.error("Error fetching OpenAPI YAML:", err);

src/routes/(protected)/dynamic-entities/system/openapi-yaml/+page.svelte

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<script lang="ts">
22
import type { PageData } from "./$types";
33
4-
let { data }: { data: PageData } = $props();
4+
let {
5+
data,
6+
}: {
7+
data: PageData & {
8+
tags?: string | null;
9+
characterCount?: number;
10+
apiUrl?: string;
11+
};
12+
} = $props();
513
614
let copied = $state(false);
715
@@ -33,6 +41,21 @@
3341
<p class="mt-1 text-gray-600 dark:text-gray-400">
3442
OpenAPI specification for dynamic entity endpoints in YAML format
3543
</p>
44+
{#if data.tags}
45+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
46+
<span class="font-semibold">Tag:</span>
47+
{data.tags}
48+
</p>
49+
{/if}
50+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
51+
<span class="font-semibold">Character count:</span>
52+
{data.characterCount?.toLocaleString()}
53+
</p>
54+
{#if data.apiUrl}
55+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-500 font-mono">
56+
API: {data.apiUrl}
57+
</p>
58+
{/if}
3659
</div>
3760
<div class="flex gap-2">
3861
<a

0 commit comments

Comments
 (0)