Skip to content

Commit d9575e4

Browse files
committed
Reapply "Reapply "update samples""
This reverts commit 050092c.
1 parent 050092c commit d9575e4

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

modules/openapi-generator/src/main/resources/kotlin-spring/oneof_interface.mustache

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
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}}

samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Client/ClientUtils.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)