@@ -111,17 +111,17 @@ public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
111111 builder . Metadata . Add ( new ProducesSequenceResponseTypeMetadata (
112112 STATUS_CODE ,
113113 typeof ( T ) ,
114- [ .. MakePatternList . Select ( v => v . ContentType ) ] ) ) ;
114+ [ .. MakePatternList . Select ( v => new Content ( v . ContentType , v . IsStreaming ) ) ] ) ) ;
115115 }
116116
117- record MakePattern ( string ContentType , ReadOnlyMemory < byte > Begin , ReadOnlyMemory < byte > End ) ;
117+ record MakePattern ( string ContentType , ReadOnlyMemory < byte > Begin , ReadOnlyMemory < byte > End , bool IsStreaming ) ;
118118 static bool TryGetPattern ( StringSegment contentType , out ReadOnlyMemory < byte > begin , out ReadOnlyMemory < byte > end )
119119 {
120120 begin = default ;
121121 end = default ;
122122 if ( ! MediaTypeHeaderValue . TryParse ( contentType , out var parsedValue ) )
123123 return false ;
124- foreach ( var ( mediaType , begin2 , end2 ) in MakePatternList )
124+ foreach ( var ( mediaType , begin2 , end2 , _ ) in MakePatternList )
125125 if ( parsedValue . MediaType . Equals ( mediaType , StringComparison . OrdinalIgnoreCase ) == true )
126126 {
127127 ( begin , end ) = ( begin2 , end2 ) ;
@@ -175,22 +175,22 @@ static IEnumerable<MakePattern> MakePatterns()
175175#else
176176 "application/json-seq" ;
177177#endif
178- yield return new ( contentType , RS , LF ) ;
178+ yield return new ( contentType , RS , LF , true ) ;
179179 }
180180 {
181181 const string contentType =
182182 "application/x-ndjson" ;
183- yield return new ( contentType , default , LF ) ;
183+ yield return new ( contentType , default , LF , true ) ;
184184 }
185185 {
186186 const string contentType =
187187 "application/jsonl" ;
188- yield return new ( contentType , default , LF ) ;
188+ yield return new ( contentType , default , LF , true ) ;
189189 }
190190 {
191191 const string contentType =
192192 "application/json" ;
193- yield return new ( contentType , default , default ) ;
193+ yield return new ( contentType , default , default , false ) ;
194194 }
195195
196196 }
0 commit comments