File tree Expand file tree Collapse file tree 2 files changed +2
-25
lines changed
src/Microsoft.OpenApi/Writers
test/Microsoft.OpenApi.Tests/PublicApi Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -212,24 +212,11 @@ public virtual void WriteValue(bool value)
212212 Writer . Write ( value . ToString ( ) . ToLower ( ) ) ;
213213 }
214214
215- /// <summary>
216- /// Write KeyValuePair value.
217- /// </summary>
218- /// <param name="key">The key of the KeyValuePair.</param>
219- /// <param name="value">The value of the KeyValuePair.</param>
220- public virtual void WriteKeyValuePair ( object key , object value )
221- {
222- WriteStartObject ( ) ;
223- WritePropertyName ( key ? . ToString ( ) ?? string . Empty ) ;
224- WriteValue ( value ) ;
225- WriteEndObject ( ) ;
226- }
227-
228215 /// <summary>
229216 /// Write hashSet value.
230217 /// </summary>
231218 /// <param name="value">The HashSet value.</param>
232- private void WriteHashSet ( IEnumerable < object > value )
219+ public virtual void WriteHashSet ( IEnumerable < object > value )
233220 {
234221 WriteStartArray ( ) ;
235222 foreach ( var item in value )
@@ -297,16 +284,6 @@ public virtual void WriteValue(object value)
297284 {
298285 WriteHashSet ( hashSet ) ;
299286 }
300- else if ( type . IsGenericType && type . GetGenericTypeDefinition ( ) == typeof ( KeyValuePair < , > ) )
301- {
302- var key = type . GetProperty ( "Key" ) ? . GetValue ( value , null ) ;
303- var val = type . GetProperty ( "Value" ) ? . GetValue ( value , null ) ;
304-
305- if ( key != null )
306- {
307- WriteKeyValuePair ( key , val ) ;
308- }
309- }
310287 else
311288 {
312289 throw new OpenApiWriterException ( string . Format ( SRResource . OpenApiUnsupportedValueType , type . FullName ) ) ;
Original file line number Diff line number Diff line change @@ -1973,8 +1973,8 @@ namespace Microsoft.OpenApi.Writers
19731973 protected void VerifyCanWritePropertyName(string name) { }
19741974 public abstract void WriteEndArray();
19751975 public abstract void WriteEndObject();
1976+ public virtual void WriteHashSet(System.Collections.Generic.IEnumerable<object> value) { }
19761977 public virtual void WriteIndentation() { }
1977- public virtual void WriteKeyValuePair(object key, object value) { }
19781978 public abstract void WriteNull();
19791979 public abstract void WritePropertyName(string name);
19801980 public abstract void WriteRaw(string value);
You can’t perform that action at this time.
0 commit comments