Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[csharp-netcore] Add support for ComVisible, CLSCompliant attributes #12733

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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}}
Expand All @@ -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}}
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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}}
Expand All @@ -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}}
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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}}}")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,8 @@ components:
items:
$ref: '#/components/schemas/ReadOnlyFirst'
NumberOnly:
x-cls-compliant: true
x-com-visible: true
type: object
properties:
JustNumber:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
using System.Reflection;

namespace Org.OpenAPITools.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
using System.Reflection;

namespace Org.OpenAPITools.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
using System.Reflection;

namespace Org.OpenAPITools.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
using System.Reflection;

namespace Org.OpenAPITools.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
using System.Reflection;

namespace Org.OpenAPITools.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand All @@ -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
{
Expand Down