File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/kotlin-spring
samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 JsonSubTypes.Type(value = { {classname} }::class){ {^-last} },{ {/-last} }
1212 { {/interfaceModels} }
1313)
14- { {/jackson} }{ {/useDeductionForOneOfInterfaces} }{ {/discriminator} }
15- { {#additionalModelTypeAnnotations} }
14+ { {/jackson} }{ {/useDeductionForOneOfInterfaces} }{ {/discriminator} }{ {#additionalModelTypeAnnotations} }
1615{ {{.} }}
1716{ {/additionalModelTypeAnnotations} }
1817{ {#vendorExtensions.x-class-extra-annotation} }
Original file line number Diff line number Diff line change @@ -301,6 +301,35 @@ public static bool IsJsonMime(string mime)
301301 throw new JsonException ( "The specified discriminator was not found." ) ;
302302 }
303303
304+ /// <summary>
305+ /// Determines if the provided header is a content header
306+ /// </summary>
307+ /// <param name="header">The header to check</param>
308+ /// <returns>True if a content header; False otherwise</returns>
309+ public static bool IsContentHeader ( string header )
310+ {
311+ return ContentHeaders . Contains ( header . ToLowerInvariant ( ) ) ;
312+ }
313+
314+ /// <summary>
315+ /// The collection of content headers as per
316+ /// https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent.headers
317+ /// </summary>
318+ private static readonly string [ ] ContentHeaders = new String [ ]
319+ {
320+ "allow" ,
321+ "content-encoding" ,
322+ "content-disposition" ,
323+ "content-language" ,
324+ "content-length" ,
325+ "content-location" ,
326+ "content-md5" ,
327+ "content-range" ,
328+ "content-type" ,
329+ "expires" ,
330+ "last-modified"
331+ } ;
332+
304333 /// <summary>
305334 /// The base path of the API
306335 /// </summary>
You can’t perform that action at this time.
0 commit comments