forked from loafle/openapi-generator-original
[csharp-netcore] Add support for ComVisible, CLSCompliant attributes (#12733)
* add support for ComVisible, CLSCompliant attributes in csharp-netcore clients * fix import
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
{{>partial_header}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
using System.Runtime.InteropServices;
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#discriminator}}
|
||||
using JsonSubTypes;
|
||||
{{/discriminator}}
|
||||
@@ -34,11 +37,11 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/oneOf}}
|
||||
{{#aneOf}}
|
||||
{{#anyOf}}
|
||||
{{#-first}}
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/aneOf}}
|
||||
{{/anyOf}}
|
||||
|
||||
namespace {{packageName}}.{{modelPackage}}
|
||||
{
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
{{>partial_header}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
using System.Runtime.InteropServices;
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#discriminator}}
|
||||
using JsonSubTypes;
|
||||
{{/discriminator}}
|
||||
@@ -33,11 +36,11 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/oneOf}}
|
||||
{{#aneOf}}
|
||||
{{#anyOf}}
|
||||
{{#-first}}
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/aneOf}}
|
||||
{{/anyOf}}
|
||||
|
||||
namespace {{packageName}}.{{modelPackage}}
|
||||
{
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}{{classname}}{{/description}}
|
||||
/// </summary>
|
||||
{{#vendorExtensions.x-cls-compliant}}
|
||||
[CLSCompliant({{{.}}})]
|
||||
{{/vendorExtensions.x-cls-compliant}}
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
[ComVisible({{{.}}})]
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
[JsonConverter(typeof({{classname}}JsonConverter))]
|
||||
[DataContract(Name = "{{{name}}}")]
|
||||
{{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}}
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
{{#description}}
|
||||
/// <value>{{.}}</value>
|
||||
{{/description}}
|
||||
{{#vendorExtensions.x-cls-compliant}}
|
||||
[CLSCompliant({{{.}}})]
|
||||
{{/vendorExtensions.x-cls-compliant}}
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
[ComVisible({{{.}}})]
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{#-first}}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}{{classname}}{{/description}}
|
||||
/// </summary>
|
||||
{{#vendorExtensions.x-cls-compliant}}
|
||||
[CLSCompliant({{{vendorExtensions.x-cls-compliant}}})]
|
||||
{{/vendorExtensions.x-cls-compliant}}
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
[ComVisible({{{vendorExtensions.x-com-visible}}})]
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
[DataContract(Name = "{{{name}}}")]
|
||||
{{#discriminator}}
|
||||
[JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")]
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}{{classname}}{{/description}}
|
||||
/// </summary>
|
||||
{{#vendorExtensions.x-cls-compliant}}
|
||||
[CLSCompliant({{{.}}})]
|
||||
{{/vendorExtensions.x-cls-compliant}}
|
||||
{{#vendorExtensions.x-com-visible}}
|
||||
[ComVisible({{{.}}})]
|
||||
{{/vendorExtensions.x-com-visible}}
|
||||
[JsonConverter(typeof({{classname}}JsonConverter))]
|
||||
[DataContract(Name = "{{{name}}}")]
|
||||
{{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}}
|
||||
|
||||
@@ -1697,6 +1697,8 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/ReadOnlyFirst'
|
||||
NumberOnly:
|
||||
x-cls-compliant: true
|
||||
x-com-visible: true
|
||||
type: object
|
||||
properties:
|
||||
JustNumber:
|
||||
|
||||
@@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -29,6 +30,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using FileParameter = Org.OpenAPITools.Client.FileParameter;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -30,6 +31,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -29,6 +30,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -29,6 +30,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -29,6 +30,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -29,6 +30,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[CLSCompliant(true)]
|
||||
[ComVisible(true)]
|
||||
[DataContract(Name = "NumberOnly")]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>, IValidatableObject
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user