Skip to content

Instantly share code, notes, and snippets.

@TwoSquirrels
Created December 16, 2025 13:58
Show Gist options
  • Select an option

  • Save TwoSquirrels/51b02c408223e0b89d5ec0cd70e57694 to your computer and use it in GitHub Desktop.

Select an option

Save TwoSquirrels/51b02c408223e0b89d5ec0cd70e57694 to your computer and use it in GitHub Desktop.
Cloudflare Calls API リファレンス (Gemini 製)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Cloudflare Calls API Reference</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" />
<style>
html { box-sizing: border-box; overflow: -moz-scrollbars-vertical; overflow-y: scroll; }
*, *:before, *:after { box-sizing: inherit; }
body { margin: 0; background: #fafafa; }
.swagger-ui .topbar { display: none; } /* Remove top bar */
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" charset="UTF-8"></script>
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-standalone-preset.js" charset="UTF-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
<script>
// OpenAPI YAML Definition (Japanese Translated)
const openApiYaml = `
openapi: 3.0.0
info:
title: Cloudflare Realtime API
version: "1.0"
description: |
Cloudflare Calls (Realtime SFU) の API リファレンスです。(Gemini 製)
この API は WebRTC セッションの作成、トラックの管理、データチャネルの制御を行います。
**Base URL:** \`https://rtc.live.cloudflare.com/v1\`
externalDocs:
description: Cloudflare Realtime の詳細はこちら
url: https://developers.cloudflare.com/realtime/
servers:
- url: https://rtc.live.cloudflare.com/v1
paths:
/apps/{appId}/sessions/new:
post:
tags:
- New Session
summary: 新しいピア接続 (PeerConnection) を作成する
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: query
name: thirdparty
schema:
type: boolean
description: セッションがサードパーティの SFU/サーバー のような ICE-lite ピアに接続することを意図している場合に指定
- in: query
name: correlationId
schema:
type: string
description: セッションをユーザー提供の相関ID (correlation id) に関連付ける
responses:
"201":
description: 作成完了
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/NewSessionResponse"
- example:
sessionId: e017a2629c754fedc1f7d8587e06d126
/apps/{appId}/sessions/{sessionId}/tracks/new:
post:
tags:
- Add a track
summary: 指定されたトラックオブジェクトを解決し、WebRTCセッションにトラックを追加する
description: |
このエンドポイントは最も重要です。リクエストボディの内容によって挙動が変わります。
- \`local\` トラックを指定: 配信開始 (WHIP)
- \`remote\` トラックを指定: 視聴開始 (WHEP)
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/TracksRequest"
examples:
local_tracks:
summary: 配信開始 (WHIP)
description: リモートピアで再生するためのトラックを共有する
value:
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: offer
tracks:
- location: local
mid: "4"
trackName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
remote_tracks:
summary: 視聴開始 (WHEP)
description: リモートピアからのトラックを再生する
value:
tracks:
- location: remote
sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: 2e037563-a35d-4bf6-a9ee-2d474cbb9a58
push_track_with_bidirectional_stream:
summary: 双方向ストリーム
description: 双方向トランシーバーを通じてトラックを共有する
value:
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: offer
tracks:
- location: local
mid: "0"
trackName: mic-1
bidirectionalMediaStream: true
kind: "audio"
push_track_without_an_offer:
summary: Offerなしでのプッシュ
description: SFU がローカルトラックをプッシュするための Offer を生成できるようにする
value:
tracks:
- location: local
trackName: mic-1
kind: "audio"
push_tracks_with_autodiscover:
summary: 自動検出
description: SFU が提供された SDP 内の新しいトラックを自動検出する
value:
autoDiscover: true
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: offer
pull_track_with_bidirectional_stream:
summary: 双方向でのプル
description: mid で識別される既存の双方向トランシーバーを通じてトラックを受信する
value:
tracks:
- location: remote
mid: "#mic-1"
sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: generated-audio
kind: "audio"
remote_track_with_simulcast:
summary: サイマルキャスト受信
description: サイマルキャスト (Simulcast) 設定を使用してリモートトラックを受信する
value:
tracks:
- location: remote
sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: simulcast-video-track
simulcast:
preferredRid: "h"
priorityOrdering: "asciibetical"
ridNotAvailabl: "asciibetical"
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
description: 現在の PeerConnection セッション ID
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/TracksResponse"
examples:
local_tracks:
value:
requiresImmediateRenegotiation: false
tracks:
- trackName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
mid: "4"
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: answer
remote_tracks:
value:
requiresImmediateRenegotiation: true
tracks:
- sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: 2e037563-a35d-4bf6-a9ee-2d474cbb9a58
mid: "7"
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: offer
remote_tracks_with_simulcast:
value:
requiresImmediateRenegotiation: true
tracks:
- sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: simulcast-video-track
mid: "5"
simulcast:
preferredRid: "h"
priorityOrdering: "asciibetical"
ridNotAvailabl: "asciibetical"
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
a=simulcast:recv f;h;q
a=rid:f recv
a=rid:h recv
a=rid:q recv
...
type: offer
/apps/{appId}/sessions/{sessionId}/renegotiate:
put:
tags:
- Renegotiate WebRTC session
summary: 以前の応答に requiresImmediateRenegotiation (即時再交渉が必要) が含まれていた場合、ここで再交渉を行う必要があります
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RenegotiateRequest"
example:
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: answer
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/RenegotiateResponse"
example: {}
/apps/{appId}/sessions/{sessionId}/tracks/close:
put:
tags:
- Close a track
summary: ローカルまたはリモートのトラックを閉じる
requestBody:
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CloseTracksRequest"
- example:
tracks:
- mid: "7"
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: offer
force: false
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/CloseTracksResponse"
example:
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000
...
type: answer
requiresImmediateRenegotiation: false
tracks:
- mid: "7"
/apps/{appId}/sessions/{sessionId}/tracks/update:
put:
tags:
- Change tracks
summary: 既存のトランシーバー (transceiver) を再利用してトラックを変更する
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateTracksRequest"
examples:
reuse_transceiver:
description: 既存のトランシーバーを新しいトラックに再利用する
value:
tracks:
- location: "remote"
sessionId: "2a45361d5fd7cc14eface0587c276c94"
trackName: "other-track-name"
mid: "7"
reuse_with_simulcast:
description: 新しいサイマルキャスト設定で既存のトランシーバーを再利用する
value:
tracks:
- location: "remote"
sessionId: "2a45361d5fd7cc14eface0587c276c94"
trackName: "simulcast-track"
mid: "8"
simulcast:
preferredRid: "h"
priorityOrdering: "asciibetical"
ridNotAavailable: "asciibetical"
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
description: 現在の PeerConnection セッション ID
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateTracksResponse"
examples:
success:
value:
requiresImmediateRenegotiation: false
tracks:
- mid: "7"
sessionId: "2a45361d5fd7cc14eface0587c276c94"
trackName: "new-track-name"
/apps/{appId}/sessions/{sessionId}/datachannels/establish:
post:
tags:
- Establish a data channel transport
summary: サーバーイベントチャンネルを受信するために、データチャンネルトランスポートを確立する。server-events チャンネルの受信のみ許可される
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EstablishDataChannelsTransportRequest"
examples:
ask_for_an_offer:
description: server-events チャンネルを受信するための Offer を要求する
value:
datachannel:
location: remote
dataChannelName: server-events
send_an_offer:
description: server-events チャンネルを受信するためのアプリケーションメディアセクションを含む Offer を送信する
value:
datachannel:
location: remote
dataChannelName: server-events
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
...
type: offer
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
description: 現在の PeerConnection セッション ID
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/EstablishDataChannelsTransportResponse"
examples:
ask_for_an_offer:
value:
requiresImmediateRenegotiation: true
datachannel:
location: remote
dataChannelName: server-events
id: 0
send_an_offer:
value:
requiresImmediateRenegotiation: false
datachannel:
location: remote
dataChannelName: server-events
id: 0
sessionDescription:
sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
...
type: answer
/apps/{appId}/sessions/{sessionId}/datachannels/new:
post:
tags:
- Add data channel(s)
summary: 指定されたデータチャンネルオブジェクトを解決し、WebRTCセッションにデータチャンネルを追加する。データチャンネルトランスポートが確立されている必要がある
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DataChannelsRequest"
examples:
local_datachannels:
description: リモートピアによって消費されるデータチャンネルを共有する
value:
datachannels:
- location: local
dataChannelName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
remote_datachannels:
description: リモートデータチャンネルを消費する
value:
datachannels:
- location: remote
sessionId: "2a45361d5fd7cc14eface0587c276c94"
dataChannelName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
description: 現在の PeerConnection セッション ID
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/DataChannelsResponse"
examples:
local_datachannels:
value:
datachannels:
- dataChannelName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
location: local
id: 3
remote_datachannels:
value:
datachannels:
- sessionId: 2a45361d5fd7cc14eface0587c276c94
location: remote
dataChannelName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
id: 4
/apps/{appId}/sessions/{sessionId}/datachannels/close:
put:
tags:
- Close data channel(s)
summary: ローカルまたはリモートのデータチャンネルを閉じる
requestBody:
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CloseDataChannelsRequest"
- example:
datachannels:
- id: 2
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/CloseDataChannelsResponse"
example:
datachannels:
- location: remote
sessionId: 2a45361d5fd7cc14eface0587c276c94
dataChannelName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
id: 2
/apps/{appId}/sessions/{sessionId}:
get:
tags:
- Get session state
summary: セッションに関連付けられたトラックのリストを返す
security:
- secret: []
parameters:
- in: path
name: appId
schema:
type: string
required: true
description: WebRTC アプリケーション ID
- in: path
name: sessionId
schema:
type: string
required: true
responses:
"200":
description: OK
headers:
vary:
schema:
type: string
example: Origin
content:
application/json:
schema:
$ref: "#/components/schemas/GetSessionStateResponse"
example:
tracks:
- location: local
mid: "2"
trackName: 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
status: active
- location: remote
mid: "7"
sessionId: 2a45361d5fd7cc14eface0587c276c94
trackName: 2e037563-a35d-4bf6-a9ee-2d474cbb9a58
status: active
components:
securitySchemes:
secret:
type: http
scheme: bearer
schemas:
SessionDescription:
type: object
properties:
sdp:
type: string
type:
type: string
enum:
- answer
- offer
TrackObject:
type: object
properties:
location:
type: string
enum:
- local
- remote
description: トラックを共有したい場合は local を指定。リモートエージェントが共有しているトラックを再生したい場合は remote を指定
mid:
type: string
description: トラックのトランシーバーに関連付けられた mid。trackName を使って既存のトランシーバーを参照する場合、# をプレフィックスとして付けることも可能
sessionId:
type: string
description: トラック所有者のセッション ID。リモートトラックの場合にのみ設定する必要がある
trackName:
type: string
description: トラックに付けられた名前
bidirectionalMediaStream:
type: boolean
description: 関連するトランシーバーを双方向にする。このオプションは SFU が Offer を生成する場合にのみ機能する
kind:
type: string
description: トランシーバーの種類について SFU にヒントを与える。SFU が Offer を生成する場合に必須
simulcast:
type: object
description: トラックのサイマルキャスト設定
properties:
preferredRid:
type: string
description: "サイマルキャストストリームの優先 RID (例: 'h', 'm', 'l')"
priorityOrdering:
type: string
enum:
- none
- asciibetical
default: none
description: "preferredRid を送信するための十分なネットワークリソースがない場合の動作を制御する。'none' は帯域不足でも送信を試みる、'asciibetical' は a-z の順序で優先度を決定する (a が最も望ましく、z が最も望ましくない)"
ridNotAvailable:
type: string
enum:
- none
- asciibetical
default: none
description: "現在使用中または preferredRid のレイヤーがパブリッシャーから送信されなくなった場合の動作を制御する。'none' は何もしない、'asciibetical' はレイヤーを a-z 順にソートした後、次に利用可能なレイヤーを使用する"
CloseTrackObject:
type: object
properties:
mid:
type: string
description: 閉じるトラックのトランシーバーに関連付けられた mid
TracksRequest:
type: object
properties:
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
tracks:
type: array
items:
$ref: "#/components/schemas/TrackObject"
autoDiscover:
type: boolean
description: 提供された SDP 内の新しいトラックにランダムなトラック名を割り当てる
TracksResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
requiresImmediateRenegotiation:
type: boolean
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
tracks:
type: array
items:
allOf:
- $ref: "#/components/schemas/TrackObject"
- properties:
errorCode:
type: string
errorDescription:
type: string
NewSessionRequest:
type: object
properties:
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
NewSessionResponse:
required:
- sessionId
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
sessionDescription:
type: object
properties:
sdp:
type: string
type:
type: string
enum:
- answer
- offer
sessionId:
type: string
CloseTracksRequest:
type: object
properties:
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
tracks:
type: array
items:
$ref: "#/components/schemas/CloseTrackObject"
force:
type: boolean
description: true の場合、WebRTC の再交渉を行わず、トラックのデータフローのみを停止する
CloseTracksResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
tracks:
type: array
items:
allOf:
- $ref: "#/components/schemas/CloseTrackObject"
- properties:
errorCode:
type: string
errorDescription:
type: string
requiresImmediateRenegotiation:
type: boolean
GetSessionStateResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
tracks:
type: array
items:
allOf:
- $ref: "#/components/schemas/TrackObject"
- properties:
status:
type: string
enum:
- active
- inactive
- waiting
RenegotiateRequest:
type: object
properties:
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
RenegotiateResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
ChangeTracksRequest:
type: object
properties:
tracks:
type: object
additionalProperties:
allOf:
- $ref: "#/components/schemas/TrackObject"
description: トラックを変更するための、トラックIDとトラックオブジェクトのマップ
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
UpdateTracksRequest:
type: object
properties:
tracks:
type: array
items:
$ref: "#/components/schemas/TrackObject"
description: トラックを更新するためのトラックオブジェクトの配列
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
UpdateTracksResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
requiresImmediateRenegotiation:
type: boolean
tracks:
type: array
items:
allOf:
- $ref: "#/components/schemas/TrackObject"
- properties:
errorCode:
type: string
errorDescription:
type: string
description: 結果を含むトラックオブジェクトの配列
DataChannelObject:
type: object
properties:
location:
type: string
enum:
- local
- remote
description: 指定された dataChannelName にブロードキャストする場合は local を選択。他者からのブロードキャストを受信する場合は remote を選択
sessionId:
type: string
description: データチャンネル所有者のセッション ID。リモートデータチャンネルの場合にのみ設定する
dataChannelName:
type: string
description: データチャンネルに付けられた名前
id:
type: number
description: データチャンネル ID
DataChannelsRequest:
type: object
properties:
dataChannels:
type: array
items:
$ref: "#/components/schemas/DataChannelObject"
DataChannelsResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
dataChannels:
type: array
items:
allOf:
- $ref: "#/components/schemas/DataChannelObject"
- properties:
errorCode:
type: string
errorDescription:
type: string
EstablishDataChannelsTransportRequest:
type: object
properties:
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
dataChannel:
$ref: "#/components/schemas/DataChannelObject"
EstablishDataChannelsTransportResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
sessionDescription:
$ref: "#/components/schemas/SessionDescription"
requiresImmediateRenegotiation:
type: boolean
dataChannel:
$ref: "#/components/schemas/DataChannelObject"
CloseDataChannelsRequest:
type: object
properties:
dataChannels:
type: array
items:
$ref: "#/components/schemas/DataChannelObject"
CloseDataChannelsResponse:
type: object
properties:
errorCode:
type: string
errorDescription:
type: string
dataChannels:
type: array
items:
allOf:
- $ref: "#/components/schemas/DataChannelObject"
- properties:
errorCode:
type: string
errorDescription:
type: string
`;
// Convert YAML string to JSON object
const spec = jsyaml.load(openApiYaml);
window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
spec: spec, // Pass the parsed object directly
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
supportedSubmitMethods: [] // Disable "Try it out" button as it requires real auth/backend
});
window.ui = ui;
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment