openapi.php 638 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * The OpenAPI document for api/v1, with the server URL of this installation
  5. * filled in.
  6. *
  7. * Served through PHP because the repository denies direct access to .json
  8. * files; openapi.json next to this file is the source of truth.
  9. */
  10. require_once __DIR__ . "/inc/handbook.php";
  11. $json = handbookOpenApiJson();
  12. header("Content-Type: application/json; charset=utf-8");
  13. header("Content-Disposition: inline; filename=\"manage-openapi.json\"");
  14. header("Content-Length: " . (string) strlen($json));
  15. header("X-Content-Type-Options: nosniff");
  16. header("Cache-Control: public, max-age=300");
  17. echo $json;