@@ -72,7 +72,7 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
72
72
/// <summary>
73
73
/// Serialize <see cref="OpenApiSchemaReferenceInformation"/> to Open Api v3.1.
74
74
/// </summary>
75
- public new void SerializeAsV31 ( IOpenApiWriter writer )
75
+ public override void SerializeAsV31 ( IOpenApiWriter writer )
76
76
{
77
77
Utils . CheckArgumentNull ( writer ) ;
78
78
@@ -118,7 +118,7 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
118
118
/// <summary>
119
119
/// Sets metadata fields from a JSON node during parsing
120
120
/// </summary>
121
- internal new void SetMetadataFromMapNode ( MapNode mapNode )
121
+ internal override void SetMetadataFromMapNode ( MapNode mapNode )
122
122
{
123
123
base . SetMetadataFromMapNode ( mapNode ) ;
124
124
@@ -131,28 +131,19 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
131
131
}
132
132
133
133
// Boolean properties
134
- if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . Deprecated , out var deprecatedNode ) && deprecatedNode is JsonValue deprecatedValue )
134
+ if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . Deprecated , out var deprecatedNode ) && deprecatedNode is JsonValue deprecatedValue && deprecatedValue . TryGetValue < bool > ( out var deprecated ) )
135
135
{
136
- if ( deprecatedValue . TryGetValue < bool > ( out var deprecated ) )
137
- {
138
- Deprecated = deprecated ;
139
- }
136
+ Deprecated = deprecated ;
140
137
}
141
138
142
- if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . ReadOnly , out var readOnlyNode ) && readOnlyNode is JsonValue readOnlyValue )
139
+ if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . ReadOnly , out var readOnlyNode ) && readOnlyNode is JsonValue readOnlyValue && readOnlyValue . TryGetValue < bool > ( out var readOnly ) )
143
140
{
144
- if ( readOnlyValue . TryGetValue < bool > ( out var readOnly ) )
145
- {
146
- ReadOnly = readOnly ;
147
- }
141
+ ReadOnly = readOnly ;
148
142
}
149
143
150
- if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . WriteOnly , out var writeOnlyNode ) && writeOnlyNode is JsonValue writeOnlyValue )
144
+ if ( jsonObject . TryGetPropertyValue ( OpenApiConstants . WriteOnly , out var writeOnlyNode ) && writeOnlyNode is JsonValue writeOnlyValue && writeOnlyValue . TryGetValue < bool > ( out var writeOnly ) )
151
145
{
152
- if ( writeOnlyValue . TryGetValue < bool > ( out var writeOnly ) )
153
- {
154
- WriteOnly = writeOnly ;
155
- }
146
+ WriteOnly = writeOnly ;
156
147
}
157
148
158
149
// Default value
@@ -178,4 +169,4 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
178
169
private static string ? GetPropertyValueFromNode ( JsonObject jsonObject , string key ) =>
179
170
jsonObject . TryGetPropertyValue ( key , out var valueNode ) && valueNode is JsonValue valueCast && valueCast . TryGetValue < string > ( out var strValue ) ? strValue : null ;
180
171
}
181
- }
172
+ }
0 commit comments