api: add deprecated fields to the OpenAPI definition (#5575)

This commit is contained in:
Alessandro Ros
2026-03-15 19:28:06 +01:00
committed by GitHub
parent a7290a2069
commit c6bb332664
5 changed files with 264 additions and 71 deletions
+198
View File
@@ -85,6 +85,11 @@ components:
type: string type: string
writeTimeout: writeTimeout:
type: string type: string
readBufferCount:
type: integer
format: int64
nullable: true
deprecated: true
writeQueueSize: writeQueueSize:
type: integer type: integer
format: int64 format: int64
@@ -110,6 +115,10 @@ components:
$ref: '#/components/schemas/AuthInternalUser' $ref: '#/components/schemas/AuthInternalUser'
authHTTPAddress: authHTTPAddress:
type: string type: string
externalAuthenticationURL:
type: string
nullable: true
deprecated: true
authHTTPFingerprint: authHTTPFingerprint:
type: string type: string
authHTTPExclude: authHTTPExclude:
@@ -144,6 +153,10 @@ components:
type: string type: string
apiServerCert: apiServerCert:
type: string type: string
apiAllowOrigin:
type: string
nullable: true
deprecated: true
apiAllowOrigins: apiAllowOrigins:
type: array type: array
items: items:
@@ -164,6 +177,10 @@ components:
type: string type: string
metricsServerCert: metricsServerCert:
type: string type: string
metricsAllowOrigin:
type: string
nullable: true
deprecated: true
metricsAllowOrigins: metricsAllowOrigins:
type: array type: array
items: items:
@@ -184,6 +201,10 @@ components:
type: string type: string
pprofServerCert: pprofServerCert:
type: string type: string
pprofAllowOrigin:
type: string
nullable: true
deprecated: true
pprofAllowOrigins: pprofAllowOrigins:
type: array type: array
items: items:
@@ -204,6 +225,10 @@ components:
type: string type: string
playbackServerCert: playbackServerCert:
type: string type: string
playbackAllowOrigin:
type: string
nullable: true
deprecated: true
playbackAllowOrigins: playbackAllowOrigins:
type: array type: array
items: items:
@@ -216,10 +241,24 @@ components:
# RTSP server # RTSP server
rtsp: rtsp:
type: boolean type: boolean
rtspDisable:
type: boolean
nullable: true
deprecated: true
protocols:
type: array
nullable: true
items:
type: string
deprecated: true
rtspTransports: rtspTransports:
type: array type: array
items: items:
type: string type: string
encryption:
type: string
nullable: true
deprecated: true
rtspEncryption: rtspEncryption:
type: string type: string
rtspAddress: rtspAddress:
@@ -252,14 +291,29 @@ components:
type: string type: string
rtspServerCert: rtspServerCert:
type: string type: string
authMethods:
type: array
nullable: true
items:
type: string
deprecated: true
rtspAuthMethods: rtspAuthMethods:
type: array type: array
items: items:
type: string type: string
rtspUDPReadBufferSize:
type: integer
format: uint64
nullable: true
deprecated: true
# RTMP server # RTMP server
rtmp: rtmp:
type: boolean type: boolean
rtmpDisable:
type: boolean
nullable: true
deprecated: true
rtmpEncryption: rtmpEncryption:
type: string type: string
rtmpAddress: rtmpAddress:
@@ -274,6 +328,10 @@ components:
# HLS server # HLS server
hls: hls:
type: boolean type: boolean
hlsDisable:
type: boolean
nullable: true
deprecated: true
hlsAddress: hlsAddress:
type: string type: string
hlsEncryption: hlsEncryption:
@@ -282,6 +340,10 @@ components:
type: string type: string
hlsServerCert: hlsServerCert:
type: string type: string
hlsAllowOrigin:
type: string
nullable: true
deprecated: true
hlsAllowOrigins: hlsAllowOrigins:
type: array type: array
items: items:
@@ -311,6 +373,10 @@ components:
# WebRTC server # WebRTC server
webrtc: webrtc:
type: boolean type: boolean
webrtcDisable:
type: boolean
nullable: true
deprecated: true
webrtcAddress: webrtcAddress:
type: string type: string
webrtcEncryption: webrtcEncryption:
@@ -319,6 +385,10 @@ components:
type: string type: string
webrtcServerCert: webrtcServerCert:
type: string type: string
webrtcAllowOrigin:
type: string
nullable: true
deprecated: true
webrtcAllowOrigins: webrtcAllowOrigins:
type: array type: array
items: items:
@@ -351,6 +421,26 @@ components:
type: string type: string
webrtcTrackGatherTimeout: webrtcTrackGatherTimeout:
type: string type: string
webrtcICEUDPMuxAddress:
type: string
nullable: true
deprecated: true
webrtcICETCPMuxAddress:
type: string
nullable: true
deprecated: true
webrtcICEHostNAT1To1IPs:
type: array
nullable: true
items:
type: string
deprecated: true
webrtcICEServers:
type: array
nullable: true
items:
type: string
deprecated: true
# SRT server # SRT server
srt: srt:
@@ -358,6 +448,32 @@ components:
srtAddress: srtAddress:
type: string type: string
# Record (deprecated)
record:
type: boolean
nullable: true
deprecated: true
recordPath:
type: string
nullable: true
deprecated: true
recordFormat:
type: string
nullable: true
deprecated: true
recordPartDuration:
type: string
nullable: true
deprecated: true
recordSegmentDuration:
type: string
nullable: true
deprecated: true
recordDeleteAfter:
type: string
nullable: true
deprecated: true
PathConf: PathConf:
type: object type: object
properties: properties:
@@ -380,6 +496,10 @@ components:
format: int64 format: int64
srtReadPassphrase: srtReadPassphrase:
type: string type: string
fallback:
type: string
nullable: true
deprecated: true
useAbsoluteTimestamp: useAbsoluteTimestamp:
type: boolean type: boolean
@@ -396,6 +516,10 @@ components:
# Record # Record
record: record:
type: boolean type: boolean
playback:
type: boolean
nullable: true
deprecated: true
recordPath: recordPath:
type: string type: string
recordFormat: recordFormat:
@@ -409,9 +533,43 @@ components:
recordDeleteAfter: recordDeleteAfter:
type: string type: string
# Authentication (deprecated)
publishUser:
type: string
nullable: true
deprecated: true
publishPass:
type: string
nullable: true
deprecated: true
publishIPs:
type: array
nullable: true
items:
type: string
deprecated: true
readUser:
type: string
nullable: true
deprecated: true
readPass:
type: string
nullable: true
deprecated: true
readIPs:
type: array
nullable: true
items:
type: string
deprecated: true
# Publisher source # Publisher source
overridePublisher: overridePublisher:
type: boolean type: boolean
disablePublisherOverride:
type: boolean
nullable: true
deprecated: true
srtPublishPassphrase: srtPublishPassphrase:
type: string type: string
@@ -420,10 +578,23 @@ components:
type: string type: string
rtspAnyPort: rtspAnyPort:
type: boolean type: boolean
sourceProtocol:
type: string
nullable: true
deprecated: true
sourceAnyPortEnable:
type: boolean
nullable: true
deprecated: true
rtspRangeType: rtspRangeType:
type: string type: string
rtspRangeStart: rtspRangeStart:
type: string type: string
rtspUDPReadBufferSize:
type: integer
format: uint64
nullable: true
deprecated: true
rtspUDPSourcePortRange: rtspUDPSourcePortRange:
type: array type: array
minItems: 2 minItems: 2
@@ -432,9 +603,21 @@ components:
type: integer type: integer
format: uint64 format: uint64
# MPEG-TS source
mpegtsUDPReadBufferSize:
type: integer
format: uint64
nullable: true
deprecated: true
# RTP source # RTP source
rtpSDP: rtpSDP:
type: string type: string
rtpUDPReadBufferSize:
type: integer
format: uint64
nullable: true
deprecated: true
# WHEP source # WHEP source
whepBearerToken: whepBearerToken:
@@ -539,6 +722,14 @@ components:
rpiCameraBitrate: rpiCameraBitrate:
type: integer type: integer
format: uint64 format: uint64
rpiCameraProfile:
type: string
nullable: true
deprecated: true
rpiCameraLevel:
type: string
nullable: true
deprecated: true
rpiCameraHardwareH264Profile: rpiCameraHardwareH264Profile:
type: string type: string
rpiCameraHardwareH264Level: rpiCameraHardwareH264Level:
@@ -547,6 +738,11 @@ components:
type: string type: string
rpiCameraSoftwareH264Level: rpiCameraSoftwareH264Level:
type: string type: string
rpiCameraJPEGQuality:
type: integer
format: uint64
nullable: true
deprecated: true
rpiCameraMJPEGQuality: rpiCameraMJPEGQuality:
type: integer type: integer
format: uint64 format: uint64
@@ -609,9 +805,11 @@ components:
nullable: true nullable: true
ready: ready:
type: boolean type: boolean
deprecated: true
readyTime: readyTime:
type: string type: string
nullable: true nullable: true
deprecated: true
available: available:
type: boolean type: boolean
availableTime: availableTime:
+26 -26
View File
@@ -249,7 +249,7 @@ type Conf struct {
DumpPackets bool `json:"dumpPackets"` DumpPackets bool `json:"dumpPackets"`
ReadTimeout Duration `json:"readTimeout"` ReadTimeout Duration `json:"readTimeout"`
WriteTimeout Duration `json:"writeTimeout"` WriteTimeout Duration `json:"writeTimeout"`
ReadBufferCount *int `json:"readBufferCount,omitempty"` // deprecated ReadBufferCount *int `json:"readBufferCount,omitempty" deprecated:"true"`
WriteQueueSize int `json:"writeQueueSize"` WriteQueueSize int `json:"writeQueueSize"`
UDPMaxPayloadSize int `json:"udpMaxPayloadSize"` UDPMaxPayloadSize int `json:"udpMaxPayloadSize"`
UDPReadBufferSize uint `json:"udpReadBufferSize"` UDPReadBufferSize uint `json:"udpReadBufferSize"`
@@ -261,7 +261,7 @@ type Conf struct {
AuthMethod AuthMethod `json:"authMethod"` AuthMethod AuthMethod `json:"authMethod"`
AuthInternalUsers []AuthInternalUser `json:"authInternalUsers"` AuthInternalUsers []AuthInternalUser `json:"authInternalUsers"`
AuthHTTPAddress string `json:"authHTTPAddress"` AuthHTTPAddress string `json:"authHTTPAddress"`
ExternalAuthenticationURL *string `json:"externalAuthenticationURL,omitempty"` // deprecated ExternalAuthenticationURL *string `json:"externalAuthenticationURL,omitempty" deprecated:"true"`
AuthHTTPFingerprint string `json:"authHTTPFingerprint"` AuthHTTPFingerprint string `json:"authHTTPFingerprint"`
AuthHTTPExclude []AuthInternalUserPermission `json:"authHTTPExclude"` AuthHTTPExclude []AuthInternalUserPermission `json:"authHTTPExclude"`
AuthJWTJWKS string `json:"authJWTJWKS"` AuthJWTJWKS string `json:"authJWTJWKS"`
@@ -278,7 +278,7 @@ type Conf struct {
APIEncryption bool `json:"apiEncryption"` APIEncryption bool `json:"apiEncryption"`
APIServerKey string `json:"apiServerKey"` APIServerKey string `json:"apiServerKey"`
APIServerCert string `json:"apiServerCert"` APIServerCert string `json:"apiServerCert"`
APIAllowOrigin *string `json:"apiAllowOrigin,omitempty"` // deprecated APIAllowOrigin *string `json:"apiAllowOrigin,omitempty" deprecated:"true"`
APIAllowOrigins []string `json:"apiAllowOrigins"` APIAllowOrigins []string `json:"apiAllowOrigins"`
APITrustedProxies IPNetworks `json:"apiTrustedProxies"` APITrustedProxies IPNetworks `json:"apiTrustedProxies"`
@@ -288,7 +288,7 @@ type Conf struct {
MetricsEncryption bool `json:"metricsEncryption"` MetricsEncryption bool `json:"metricsEncryption"`
MetricsServerKey string `json:"metricsServerKey"` MetricsServerKey string `json:"metricsServerKey"`
MetricsServerCert string `json:"metricsServerCert"` MetricsServerCert string `json:"metricsServerCert"`
MetricsAllowOrigin *string `json:"metricsAllowOrigin,omitempty"` // deprecated MetricsAllowOrigin *string `json:"metricsAllowOrigin,omitempty" deprecated:"true"`
MetricsAllowOrigins []string `json:"metricsAllowOrigins"` MetricsAllowOrigins []string `json:"metricsAllowOrigins"`
MetricsTrustedProxies IPNetworks `json:"metricsTrustedProxies"` MetricsTrustedProxies IPNetworks `json:"metricsTrustedProxies"`
@@ -298,7 +298,7 @@ type Conf struct {
PPROFEncryption bool `json:"pprofEncryption"` PPROFEncryption bool `json:"pprofEncryption"`
PPROFServerKey string `json:"pprofServerKey"` PPROFServerKey string `json:"pprofServerKey"`
PPROFServerCert string `json:"pprofServerCert"` PPROFServerCert string `json:"pprofServerCert"`
PPROFAllowOrigin *string `json:"pprofAllowOrigin,omitempty"` // deprecated PPROFAllowOrigin *string `json:"pprofAllowOrigin,omitempty" deprecated:"true"`
PPROFAllowOrigins []string `json:"pprofAllowOrigins"` PPROFAllowOrigins []string `json:"pprofAllowOrigins"`
PPROFTrustedProxies IPNetworks `json:"pprofTrustedProxies"` PPROFTrustedProxies IPNetworks `json:"pprofTrustedProxies"`
@@ -308,16 +308,16 @@ type Conf struct {
PlaybackEncryption bool `json:"playbackEncryption"` PlaybackEncryption bool `json:"playbackEncryption"`
PlaybackServerKey string `json:"playbackServerKey"` PlaybackServerKey string `json:"playbackServerKey"`
PlaybackServerCert string `json:"playbackServerCert"` PlaybackServerCert string `json:"playbackServerCert"`
PlaybackAllowOrigin *string `json:"playbackAllowOrigin,omitempty"` // deprecated PlaybackAllowOrigin *string `json:"playbackAllowOrigin,omitempty" deprecated:"true"`
PlaybackAllowOrigins []string `json:"playbackAllowOrigins"` PlaybackAllowOrigins []string `json:"playbackAllowOrigins"`
PlaybackTrustedProxies IPNetworks `json:"playbackTrustedProxies"` PlaybackTrustedProxies IPNetworks `json:"playbackTrustedProxies"`
// RTSP server // RTSP server
RTSP bool `json:"rtsp"` RTSP bool `json:"rtsp"`
RTSPDisable *bool `json:"rtspDisable,omitempty"` // deprecated RTSPDisable *bool `json:"rtspDisable,omitempty" deprecated:"true"`
Protocols *RTSPTransports `json:"protocols,omitempty"` // deprecated Protocols *RTSPTransports `json:"protocols,omitempty" deprecated:"true"`
RTSPTransports RTSPTransports `json:"rtspTransports"` RTSPTransports RTSPTransports `json:"rtspTransports"`
Encryption *Encryption `json:"encryption,omitempty"` // deprecated Encryption *Encryption `json:"encryption,omitempty" deprecated:"true"`
RTSPEncryption Encryption `json:"rtspEncryption"` RTSPEncryption Encryption `json:"rtspEncryption"`
RTSPAddress string `json:"rtspAddress"` RTSPAddress string `json:"rtspAddress"`
RTSPSAddress string `json:"rtspsAddress"` RTSPSAddress string `json:"rtspsAddress"`
@@ -334,13 +334,13 @@ type Conf struct {
ServerCert *string `json:"serverCert,omitempty"` ServerCert *string `json:"serverCert,omitempty"`
RTSPServerKey string `json:"rtspServerKey"` RTSPServerKey string `json:"rtspServerKey"`
RTSPServerCert string `json:"rtspServerCert"` RTSPServerCert string `json:"rtspServerCert"`
AuthMethods *RTSPAuthMethods `json:"authMethods,omitempty"` // deprecated AuthMethods *RTSPAuthMethods `json:"authMethods,omitempty" deprecated:"true"`
RTSPAuthMethods RTSPAuthMethods `json:"rtspAuthMethods"` RTSPAuthMethods RTSPAuthMethods `json:"rtspAuthMethods"`
RTSPUDPReadBufferSize *uint `json:"rtspUDPReadBufferSize,omitempty"` // deprecated RTSPUDPReadBufferSize *uint `json:"rtspUDPReadBufferSize,omitempty" deprecated:"true"`
// RTMP server // RTMP server
RTMP bool `json:"rtmp"` RTMP bool `json:"rtmp"`
RTMPDisable *bool `json:"rtmpDisable,omitempty"` // deprecated RTMPDisable *bool `json:"rtmpDisable,omitempty" deprecated:"true"`
RTMPEncryption Encryption `json:"rtmpEncryption"` RTMPEncryption Encryption `json:"rtmpEncryption"`
RTMPAddress string `json:"rtmpAddress"` RTMPAddress string `json:"rtmpAddress"`
RTMPSAddress string `json:"rtmpsAddress"` RTMPSAddress string `json:"rtmpsAddress"`
@@ -349,12 +349,12 @@ type Conf struct {
// HLS server // HLS server
HLS bool `json:"hls"` HLS bool `json:"hls"`
HLSDisable *bool `json:"hlsDisable,omitempty"` // deprecated HLSDisable *bool `json:"hlsDisable,omitempty" deprecated:"true"`
HLSAddress string `json:"hlsAddress"` HLSAddress string `json:"hlsAddress"`
HLSEncryption bool `json:"hlsEncryption"` HLSEncryption bool `json:"hlsEncryption"`
HLSServerKey string `json:"hlsServerKey"` HLSServerKey string `json:"hlsServerKey"`
HLSServerCert string `json:"hlsServerCert"` HLSServerCert string `json:"hlsServerCert"`
HLSAllowOrigin *string `json:"hlsAllowOrigin,omitempty"` // deprecated HLSAllowOrigin *string `json:"hlsAllowOrigin,omitempty" deprecated:"true"`
HLSAllowOrigins []string `json:"hlsAllowOrigins"` HLSAllowOrigins []string `json:"hlsAllowOrigins"`
HLSTrustedProxies IPNetworks `json:"hlsTrustedProxies"` HLSTrustedProxies IPNetworks `json:"hlsTrustedProxies"`
HLSAlwaysRemux bool `json:"hlsAlwaysRemux"` HLSAlwaysRemux bool `json:"hlsAlwaysRemux"`
@@ -368,12 +368,12 @@ type Conf struct {
// WebRTC server // WebRTC server
WebRTC bool `json:"webrtc"` WebRTC bool `json:"webrtc"`
WebRTCDisable *bool `json:"webrtcDisable,omitempty"` // deprecated WebRTCDisable *bool `json:"webrtcDisable,omitempty" deprecated:"true"`
WebRTCAddress string `json:"webrtcAddress"` WebRTCAddress string `json:"webrtcAddress"`
WebRTCEncryption bool `json:"webrtcEncryption"` WebRTCEncryption bool `json:"webrtcEncryption"`
WebRTCServerKey string `json:"webrtcServerKey"` WebRTCServerKey string `json:"webrtcServerKey"`
WebRTCServerCert string `json:"webrtcServerCert"` WebRTCServerCert string `json:"webrtcServerCert"`
WebRTCAllowOrigin *string `json:"webrtcAllowOrigin,omitempty"` // deprecated WebRTCAllowOrigin *string `json:"webrtcAllowOrigin,omitempty" deprecated:"true"`
WebRTCAllowOrigins []string `json:"webrtcAllowOrigins"` WebRTCAllowOrigins []string `json:"webrtcAllowOrigins"`
WebRTCTrustedProxies IPNetworks `json:"webrtcTrustedProxies"` WebRTCTrustedProxies IPNetworks `json:"webrtcTrustedProxies"`
WebRTCLocalUDPAddress string `json:"webrtcLocalUDPAddress"` WebRTCLocalUDPAddress string `json:"webrtcLocalUDPAddress"`
@@ -385,22 +385,22 @@ type Conf struct {
WebRTCSTUNGatherTimeout Duration `json:"webrtcSTUNGatherTimeout"` WebRTCSTUNGatherTimeout Duration `json:"webrtcSTUNGatherTimeout"`
WebRTCHandshakeTimeout Duration `json:"webrtcHandshakeTimeout"` WebRTCHandshakeTimeout Duration `json:"webrtcHandshakeTimeout"`
WebRTCTrackGatherTimeout Duration `json:"webrtcTrackGatherTimeout"` WebRTCTrackGatherTimeout Duration `json:"webrtcTrackGatherTimeout"`
WebRTCICEUDPMuxAddress *string `json:"webrtcICEUDPMuxAddress,omitempty"` // deprecated WebRTCICEUDPMuxAddress *string `json:"webrtcICEUDPMuxAddress,omitempty" deprecated:"true"`
WebRTCICETCPMuxAddress *string `json:"webrtcICETCPMuxAddress,omitempty"` // deprecated WebRTCICETCPMuxAddress *string `json:"webrtcICETCPMuxAddress,omitempty" deprecated:"true"`
WebRTCICEHostNAT1To1IPs *[]string `json:"webrtcICEHostNAT1To1IPs,omitempty"` // deprecated WebRTCICEHostNAT1To1IPs *[]string `json:"webrtcICEHostNAT1To1IPs,omitempty" deprecated:"true"`
WebRTCICEServers *[]string `json:"webrtcICEServers,omitempty"` // deprecated WebRTCICEServers *[]string `json:"webrtcICEServers,omitempty" deprecated:"true"`
// SRT server // SRT server
SRT bool `json:"srt"` SRT bool `json:"srt"`
SRTAddress string `json:"srtAddress"` SRTAddress string `json:"srtAddress"`
// Record (deprecated) // Record (deprecated)
Record *bool `json:"record,omitempty"` // deprecated Record *bool `json:"record,omitempty" deprecated:"true"`
RecordPath *string `json:"recordPath,omitempty"` // deprecated RecordPath *string `json:"recordPath,omitempty" deprecated:"true"`
RecordFormat *RecordFormat `json:"recordFormat,omitempty"` // deprecated RecordFormat *RecordFormat `json:"recordFormat,omitempty" deprecated:"true"`
RecordPartDuration *Duration `json:"recordPartDuration,omitempty"` // deprecated RecordPartDuration *Duration `json:"recordPartDuration,omitempty" deprecated:"true"`
RecordSegmentDuration *Duration `json:"recordSegmentDuration,omitempty"` // deprecated RecordSegmentDuration *Duration `json:"recordSegmentDuration,omitempty" deprecated:"true"`
RecordDeleteAfter *Duration `json:"recordDeleteAfter,omitempty"` // deprecated RecordDeleteAfter *Duration `json:"recordDeleteAfter,omitempty" deprecated:"true"`
// Path defaults // Path defaults
PathDefaults Path `json:"pathDefaults"` PathDefaults Path `json:"pathDefaults"`
+17 -17
View File
@@ -180,7 +180,7 @@ type Path struct {
SourceOnDemandCloseAfter Duration `json:"sourceOnDemandCloseAfter"` SourceOnDemandCloseAfter Duration `json:"sourceOnDemandCloseAfter"`
MaxReaders int `json:"maxReaders"` MaxReaders int `json:"maxReaders"`
SRTReadPassphrase string `json:"srtReadPassphrase"` SRTReadPassphrase string `json:"srtReadPassphrase"`
Fallback *string `json:"fallback,omitempty"` // deprecated Fallback *string `json:"fallback,omitempty" deprecated:"true"`
UseAbsoluteTimestamp bool `json:"useAbsoluteTimestamp"` UseAbsoluteTimestamp bool `json:"useAbsoluteTimestamp"`
// Always available // Always available
@@ -190,7 +190,7 @@ type Path struct {
// Record // Record
Record bool `json:"record"` Record bool `json:"record"`
Playback *bool `json:"playback,omitempty"` // deprecated Playback *bool `json:"playback,omitempty" deprecated:"true"`
RecordPath string `json:"recordPath"` RecordPath string `json:"recordPath"`
RecordFormat RecordFormat `json:"recordFormat"` RecordFormat RecordFormat `json:"recordFormat"`
RecordPartDuration Duration `json:"recordPartDuration"` RecordPartDuration Duration `json:"recordPartDuration"`
@@ -199,34 +199,34 @@ type Path struct {
RecordDeleteAfter Duration `json:"recordDeleteAfter"` RecordDeleteAfter Duration `json:"recordDeleteAfter"`
// Authentication (deprecated) // Authentication (deprecated)
PublishUser *Credential `json:"publishUser,omitempty"` // deprecated PublishUser *Credential `json:"publishUser,omitempty" deprecated:"true"`
PublishPass *Credential `json:"publishPass,omitempty"` // deprecated PublishPass *Credential `json:"publishPass,omitempty" deprecated:"true"`
PublishIPs *IPNetworks `json:"publishIPs,omitempty"` // deprecated PublishIPs *IPNetworks `json:"publishIPs,omitempty" deprecated:"true"`
ReadUser *Credential `json:"readUser,omitempty"` // deprecated ReadUser *Credential `json:"readUser,omitempty" deprecated:"true"`
ReadPass *Credential `json:"readPass,omitempty"` // deprecated ReadPass *Credential `json:"readPass,omitempty" deprecated:"true"`
ReadIPs *IPNetworks `json:"readIPs,omitempty"` // deprecated ReadIPs *IPNetworks `json:"readIPs,omitempty" deprecated:"true"`
// Publisher source // Publisher source
OverridePublisher bool `json:"overridePublisher"` OverridePublisher bool `json:"overridePublisher"`
DisablePublisherOverride *bool `json:"disablePublisherOverride,omitempty"` // deprecated DisablePublisherOverride *bool `json:"disablePublisherOverride,omitempty" deprecated:"true"`
SRTPublishPassphrase string `json:"srtPublishPassphrase"` SRTPublishPassphrase string `json:"srtPublishPassphrase"`
// RTSP source // RTSP source
RTSPTransport RTSPTransport `json:"rtspTransport"` RTSPTransport RTSPTransport `json:"rtspTransport"`
RTSPAnyPort bool `json:"rtspAnyPort"` RTSPAnyPort bool `json:"rtspAnyPort"`
SourceProtocol *RTSPTransport `json:"sourceProtocol,omitempty"` // deprecated SourceProtocol *RTSPTransport `json:"sourceProtocol,omitempty" deprecated:"true"`
SourceAnyPortEnable *bool `json:"sourceAnyPortEnable,omitempty"` // deprecated SourceAnyPortEnable *bool `json:"sourceAnyPortEnable,omitempty" deprecated:"true"`
RTSPRangeType RTSPRangeType `json:"rtspRangeType"` RTSPRangeType RTSPRangeType `json:"rtspRangeType"`
RTSPRangeStart string `json:"rtspRangeStart"` RTSPRangeStart string `json:"rtspRangeStart"`
RTSPUDPReadBufferSize *uint `json:"rtspUDPReadBufferSize,omitempty"` // deprecated RTSPUDPReadBufferSize *uint `json:"rtspUDPReadBufferSize,omitempty" deprecated:"true"`
RTSPUDPSourcePortRange []uint `json:"rtspUDPSourcePortRange"` RTSPUDPSourcePortRange []uint `json:"rtspUDPSourcePortRange"`
// MPEG-TS source // MPEG-TS source
MPEGTSUDPReadBufferSize *uint `json:"mpegtsUDPReadBufferSize,omitempty"` // deprecated MPEGTSUDPReadBufferSize *uint `json:"mpegtsUDPReadBufferSize,omitempty" deprecated:"true"`
// RTP source // RTP source
RTPSDP string `json:"rtpSDP"` RTPSDP string `json:"rtpSDP"`
RTPUDPReadBufferSize *uint `json:"rtpUDPReadBufferSize,omitempty"` // deprecated RTPUDPReadBufferSize *uint `json:"rtpUDPReadBufferSize,omitempty" deprecated:"true"`
// WHEP source // WHEP source
WHEPBearerToken string `json:"whepBearerToken"` WHEPBearerToken string `json:"whepBearerToken"`
@@ -272,13 +272,13 @@ type Path struct {
RPICameraCodec string `json:"rpiCameraCodec"` RPICameraCodec string `json:"rpiCameraCodec"`
RPICameraIDRPeriod uint `json:"rpiCameraIDRPeriod"` RPICameraIDRPeriod uint `json:"rpiCameraIDRPeriod"`
RPICameraBitrate uint `json:"rpiCameraBitrate"` RPICameraBitrate uint `json:"rpiCameraBitrate"`
RPICameraProfile *string `json:"rpiCameraProfile,omitempty"` // deprecated RPICameraProfile *string `json:"rpiCameraProfile,omitempty" deprecated:"true"`
RPICameraLevel *string `json:"rpiCameraLevel,omitempty"` // deprecated RPICameraLevel *string `json:"rpiCameraLevel,omitempty" deprecated:"true"`
RPICameraHardwareH264Profile string `json:"rpiCameraHardwareH264Profile"` RPICameraHardwareH264Profile string `json:"rpiCameraHardwareH264Profile"`
RPICameraHardwareH264Level string `json:"rpiCameraHardwareH264Level"` RPICameraHardwareH264Level string `json:"rpiCameraHardwareH264Level"`
RPICameraSoftwareH264Profile string `json:"rpiCameraSoftwareH264Profile"` RPICameraSoftwareH264Profile string `json:"rpiCameraSoftwareH264Profile"`
RPICameraSoftwareH264Level string `json:"rpiCameraSoftwareH264Level"` RPICameraSoftwareH264Level string `json:"rpiCameraSoftwareH264Level"`
RPICameraJPEGQuality *uint `json:"rpiCameraJPEGQuality,omitempty"` // deprecated RPICameraJPEGQuality *uint `json:"rpiCameraJPEGQuality,omitempty" deprecated:"true"`
RPICameraMJPEGQuality uint `json:"rpiCameraMJPEGQuality"` RPICameraMJPEGQuality uint `json:"rpiCameraMJPEGQuality"`
RPICameraPrimaryName string `json:"-"` // filled by Validate() RPICameraPrimaryName string `json:"-"` // filled by Validate()
RPICameraSecondaryWidth uint `json:"-"` // filled by Validate() RPICameraSecondaryWidth uint `json:"-"` // filled by Validate()
+2 -2
View File
@@ -90,8 +90,8 @@ type APIPathReader struct {
type APIPath struct { type APIPath struct {
Name string `json:"name"` Name string `json:"name"`
ConfName string `json:"confName"` ConfName string `json:"confName"`
Ready bool `json:"ready"` // deprecated Ready bool `json:"ready" deprecated:"true"`
ReadyTime *time.Time `json:"readyTime"` // deprecated ReadyTime *time.Time `json:"readyTime" deprecated:"true"`
Available bool `json:"available"` Available bool `json:"available"`
AvailableTime *time.Time `json:"availableTime"` AvailableTime *time.Time `json:"availableTime"`
Online bool `json:"online"` Online bool `json:"online"`
+21 -26
View File
@@ -17,11 +17,12 @@ import (
) )
type openAPIProperty struct { type openAPIProperty struct {
Ref string `yaml:"$ref"` Ref string `yaml:"$ref"`
Type string `yaml:"type"` Type string `yaml:"type"`
Format string `yaml:"format"` Format string `yaml:"format"`
Nullable bool `yaml:"nullable"` Nullable bool `yaml:"nullable"`
Items *openAPIProperty `yaml:"items"` Deprecated bool `yaml:"deprecated"`
Items *openAPIProperty `yaml:"items"`
} }
type openAPISchema struct { type openAPISchema struct {
@@ -35,17 +36,17 @@ type openAPI struct {
} `yaml:"components"` } `yaml:"components"`
} }
func fillProperty(t *testing.T, rt reflect.Type, existing openAPIProperty) openAPIProperty { func fillProperty(t *testing.T, rt reflect.Type) openAPIProperty {
if rt.Kind() == reflect.Pointer {
prop := fillProperty(t, rt.Elem())
prop.Nullable = true
return prop
}
switch { switch {
case rt == reflect.TypeOf(""): case rt == reflect.TypeOf(""):
return openAPIProperty{Type: "string"} return openAPIProperty{Type: "string"}
case rt == reflect.PointerTo(reflect.TypeOf("")):
return openAPIProperty{
Type: "string",
Nullable: true,
}
case rt == reflect.TypeOf(int(0)): case rt == reflect.TypeOf(int(0)):
return openAPIProperty{Type: "integer", Format: "int64"} return openAPIProperty{Type: "integer", Format: "int64"}
@@ -61,15 +62,9 @@ func fillProperty(t *testing.T, rt reflect.Type, existing openAPIProperty) openA
case rt == reflect.TypeOf(false): case rt == reflect.TypeOf(false):
return openAPIProperty{Type: "boolean"} return openAPIProperty{Type: "boolean"}
case rt == reflect.TypeOf(&time.Time{}):
return openAPIProperty{Type: "string", Nullable: true}
case rt == reflect.TypeOf(uuid.UUID{}): case rt == reflect.TypeOf(uuid.UUID{}):
return openAPIProperty{Type: "string", Format: "uuid"} return openAPIProperty{Type: "string", Format: "uuid"}
case rt == reflect.PointerTo(reflect.TypeOf(uuid.UUID{})):
return openAPIProperty{Type: "string", Format: "uuid", Nullable: true}
case rt == reflect.TypeOf(time.Time{}) || case rt == reflect.TypeOf(time.Time{}) ||
rt == reflect.TypeOf(conf.Duration(0)) || rt == reflect.TypeOf(conf.Duration(0)) ||
rt == reflect.TypeOf(conf.IPNetwork{}) || rt == reflect.TypeOf(conf.IPNetwork{}) ||
@@ -110,13 +105,8 @@ func fillProperty(t *testing.T, rt reflect.Type, existing openAPIProperty) openA
Ref: "#/components/schemas/" + schemaName, Ref: "#/components/schemas/" + schemaName,
} }
case rt.Kind() == reflect.Pointer && rt.Elem().Kind() == reflect.Struct:
prop := fillProperty(t, rt.Elem(), existing)
prop.Nullable = true
return prop
case rt.Kind() == reflect.Slice: case rt.Kind() == reflect.Slice:
items := fillProperty(t, rt.Elem(), *existing.Items) items := fillProperty(t, rt.Elem())
return openAPIProperty{ return openAPIProperty{
Type: "array", Type: "array",
Items: &items, Items: &items,
@@ -258,9 +248,14 @@ func TestGo2API(t *testing.T) {
for i := range ty.NumField() { for i := range ty.NumField() {
sf := ty.Field(i) sf := ty.Field(i)
js := sf.Tag.Get("json") js := sf.Tag.Get("json")
name, _, _ := strings.Cut(js, ",")
deprecated := sf.Tag.Get("deprecated") == "true"
if js != "-" && js != "paths" && js != "pathDefaults" && !strings.Contains(js, ",omitempty") { if name != "" && name != "-" && name != "paths" && name != "pathDefaults" &&
content2.Properties[js] = fillProperty(t, sf.Type, content1.Properties[js]) (!strings.Contains(js, ",omitempty") || deprecated) {
prop := fillProperty(t, sf.Type)
prop.Deprecated = deprecated
content2.Properties[name] = prop
} }
} }