Change API parser to handle nested objects (#159)

* rewrite parser to handle new format and nested objects

* add properties section also to nested properties

* update docs manually
This commit is contained in:
pascal-fischer
2024-02-29 15:24:00 +02:00
committed by GitHub
parent 69cddadbe4
commit dd08a8e07d
23 changed files with 4242 additions and 1260 deletions

View File

@@ -29,6 +29,8 @@ export const apiNavigation = [
{ title: 'Groups', href: '/api/resources/groups' },
{ title: 'Rules', href: '/api/resources/rules' },
{ title: 'Policies', href: '/api/resources/policies' },
{ title: 'Posture-Checks', href: '/api/resources/posture-checks' },
{ title: 'Geo-Locations', href: '/api/resources/geo-locations' },
{ title: 'Routes', href: '/api/resources/routes' },
{ title: 'DNS', href: '/api/resources/dns' },
{ title: 'Events', href: '/api/resources/events' },

View File

@@ -98,12 +98,12 @@ export function Property({ name, type, required, min, max, minLen, maxLen, enumL
{type}
</dd>
<dt className="sr-only">Required</dt>
<dd className="font-mono text-xs text-red-600 dark:text-red-600">
{required && 'required'}
</dd>
<dd className="font-mono text-xs text-zinc-400 dark:text-zinc-500">
{!required && 'optional'}
</dd>
{required && <dd className="font-mono text-xs text-red-600 dark:text-red-600">
required
</dd>}
{!required && <dd className="font-mono text-xs text-zinc-400 dark:text-zinc-500">
optional
</dd>}
<dt className="sr-only">Enum</dt>
<dd className="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
{/*{enumList && "Possible values: [" + enumList.split(',').forEach((type) => (<tag>{type}</tag>)) + "]"}*/}