@@ -72,7 +72,7 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
7272 /// <summary>
7373 /// Serialize <see cref="OpenApiSchemaReferenceInformation"/> to Open Api v3.1.
7474 /// </summary>
75- public new void SerializeAsV31 ( IOpenApiWriter writer )
75+ public override void SerializeAsV31 ( IOpenApiWriter writer )
7676 {
7777 Utils . CheckArgumentNull ( writer ) ;
7878
@@ -118,7 +118,7 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
118118 /// <summary>
119119 /// Sets metadata fields from a JSON node during parsing
120120 /// </summary>
121- internal new void SetMetadataFromMapNode ( MapNode mapNode )
121+ internal override void SetMetadataFromMapNode ( MapNode mapNode )
122122 {
123123 base . SetMetadataFromMapNode ( mapNode ) ;
124124
@@ -131,28 +131,19 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
131131 }
132132
133133 // 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 ) )
135135 {
136- if ( deprecatedValue . TryGetValue < bool > ( out var deprecated ) )
137- {
138- Deprecated = deprecated ;
139- }
136+ Deprecated = deprecated ;
140137 }
141138
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 ) )
143140 {
144- if ( readOnlyValue . TryGetValue < bool > ( out var readOnly ) )
145- {
146- ReadOnly = readOnly ;
147- }
141+ ReadOnly = readOnly ;
148142 }
149143
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 ) )
151145 {
152- if ( writeOnlyValue . TryGetValue < bool > ( out var writeOnly ) )
153- {
154- WriteOnly = writeOnly ;
155- }
146+ WriteOnly = writeOnly ;
156147 }
157148
158149 // Default value
@@ -178,4 +169,4 @@ public OpenApiSchemaReferenceInformation(OpenApiSchemaReferenceInformation refer
178169 private static string ? GetPropertyValueFromNode ( JsonObject jsonObject , string key ) =>
179170 jsonObject . TryGetPropertyValue ( key , out var valueNode ) && valueNode is JsonValue valueCast && valueCast . TryGetValue < string > ( out var strValue ) ? strValue : null ;
180171 }
181- }
172+ }
0 commit comments