xref: /dokuwiki/lib/exe/openapi.php (revision 5ee967131bce659b574445c2fa89652b7227b2cf)
1*5ee96713SAndreas Gohr<?php
2*5ee96713SAndreas Gohr
3*5ee96713SAndreas Gohrif (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
4*5ee96713SAndreas Gohrif (!defined('NOSESSION')) define('NOSESSION', true); // no session or auth required here
5*5ee96713SAndreas Gohr
6*5ee96713SAndreas Gohrrequire_once(DOKU_INC . 'inc/init.php');
7*5ee96713SAndreas Gohrglobal $INPUT;
8*5ee96713SAndreas Gohr
9*5ee96713SAndreas Gohrif ($INPUT->has('spec')) {
10*5ee96713SAndreas Gohr    header('Content-Type: application/json');
11*5ee96713SAndreas Gohr    $apigen = new \dokuwiki\Remote\OpenAPIGenerator();
12*5ee96713SAndreas Gohr    echo $apigen->generate();
13*5ee96713SAndreas Gohr    exit();
14*5ee96713SAndreas Gohr}
15*5ee96713SAndreas Gohr?>
16*5ee96713SAndreas Gohr<!doctype html>
17*5ee96713SAndreas Gohr<html lang="en">
18*5ee96713SAndreas Gohr<head>
19*5ee96713SAndreas Gohr    <meta charset="utf-8">
20*5ee96713SAndreas Gohr    <script src="https://unpkg.com/openapi-explorer/dist/browser/openapi-explorer.min.js" type="module" defer=""></script>
21*5ee96713SAndreas Gohr    <style>
22*5ee96713SAndreas Gohr        body {
23*5ee96713SAndreas Gohr            font-family: sans-serif;
24*5ee96713SAndreas Gohr        }
25*5ee96713SAndreas Gohr    </style>
26*5ee96713SAndreas Gohr</head>
27*5ee96713SAndreas Gohr<body>
28*5ee96713SAndreas Gohr<openapi-explorer
29*5ee96713SAndreas Gohr    spec-url="<?php echo DOKU_URL ?>lib/exe/openapi.php?spec=1"
30*5ee96713SAndreas Gohr    hide-server-selection="true"
31*5ee96713SAndreas Gohr    default-schema-tab="body"
32*5ee96713SAndreas Gohr    use-path-in-nav-bar="true"
33*5ee96713SAndreas Gohr></openapi-explorer>
34*5ee96713SAndreas Gohr</body>
35*5ee96713SAndreas Gohr</html>
36*5ee96713SAndreas Gohr
37*5ee96713SAndreas Gohr
38