@@ -26,11 +26,31 @@ public record ExternalResourceDefinition
26
26
[ DataMember ( Name = "name" , Order = 1 ) , JsonPropertyName ( "name" ) , JsonPropertyOrder ( 1 ) , YamlMember ( Alias = "name" , Order = 1 ) ]
27
27
public virtual string ? Name { get ; set ; }
28
28
29
+ /// <summary>
30
+ /// Gets/sets the endpoint at which to get the defined resource
31
+ /// </summary>
32
+ [ IgnoreDataMember , JsonIgnore , YamlIgnore ]
33
+ public virtual EndpointDefinition Endpoint
34
+ {
35
+ get => this . EndpointValue . T1Value ?? new ( ) { Uri = this . EndpointUri } ;
36
+ set => this . EndpointValue = value ;
37
+ }
38
+
39
+ /// <summary>
40
+ /// Gets/sets the endpoint at which to get the defined resource
41
+ /// </summary>
42
+ [ IgnoreDataMember , JsonIgnore , YamlIgnore ]
43
+ public virtual Uri EndpointUri
44
+ {
45
+ get => this . EndpointValue . T1Value ? . Uri ?? this . EndpointValue . T2Value ! ;
46
+ set => this . EndpointValue = value ;
47
+ }
48
+
29
49
/// <summary>
30
50
/// Gets/sets the endpoint at which to get the defined resource
31
51
/// </summary>
32
52
[ Required ]
33
- [ DataMember ( Name = "endpoint" , Order = 2 ) , JsonPropertyName ( "endpoint" ) , JsonPropertyOrder ( 2 ) , YamlMember ( Alias = "endpoint" , Order = 2 ) ]
34
- public virtual OneOf < EndpointDefinition , Uri > Endpoint { get ; set ; } = null ! ;
53
+ [ DataMember ( Name = "endpoint" , Order = 2 ) , JsonInclude , JsonPropertyName ( "endpoint" ) , JsonPropertyOrder ( 2 ) , YamlMember ( Alias = "endpoint" , Order = 2 ) ]
54
+ protected virtual OneOf < EndpointDefinition , Uri > EndpointValue { get ; set ; } = null ! ;
35
55
36
56
}
0 commit comments