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