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] Fixed property naming convention for composed types #18312

Merged
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
Expand Up @@ -585,7 +585,7 @@ public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs)
List<CodegenProperty> allOf = composedSchemas.getAllOf();
if (allOf != null) {
for (CodegenProperty property : allOf) {
property.name = patchPropertyName(model, property.baseType);
property.name = patchPropertyName(model, camelize(property.baseType));
patchPropertyVendorExtensions(property);
}
}
Expand All @@ -594,7 +594,7 @@ public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs)
if (anyOf != null) {
removePropertiesDeclaredInComposedTypes(objs, model, anyOf);
for (CodegenProperty property : anyOf) {
property.name = patchPropertyName(model, property.baseType);
property.name = patchPropertyName(model, camelize(property.baseType));
property.isNullable = true;
patchPropertyVendorExtensions(property);
}
Expand All @@ -604,7 +604,7 @@ public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs)
if (oneOf != null) {
removePropertiesDeclaredInComposedTypes(objs, model, oneOf);
for (CodegenProperty property : oneOf) {
property.name = patchPropertyName(model, property.baseType);
property.name = patchPropertyName(model, camelize(property.baseType));
property.isNullable = true;
patchPropertyVendorExtensions(property);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public partial class OneOfString : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="OneOfString" /> class.
/// </summary>
/// <param name="varString"></param>
internal OneOfString(string varString)
/// <param name="string"></param>
internal OneOfString(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

partial void OnCreated();

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string VarString { get; set; }
public string String { get; set; }

/// <summary>
/// Gets or Sets additional properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ public partial class PolymorphicProperty : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varBool"></param>
internal PolymorphicProperty(bool varBool)
/// <param name="bool"></param>
internal PolymorphicProperty(bool @bool)
{
VarBool = varBool;
Bool = @bool;
OnCreated();
}

/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varString"></param>
internal PolymorphicProperty(string varString)
/// <param name="string"></param>
internal PolymorphicProperty(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

Expand All @@ -72,14 +72,14 @@ internal PolymorphicProperty(List<string> list)
partial void OnCreated();

/// <summary>
/// Gets or Sets VarBool
/// Gets or Sets Bool
/// </summary>
public bool? VarBool { get; set; }
public bool? Bool { get; set; }

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string VarString { get; set; }
public string String { get; set; }

/// <summary>
/// Gets or Sets Object
Expand Down Expand Up @@ -159,11 +159,11 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type

if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1)
{
Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool);
Utf8JsonReader utf8JsonReaderBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool);

Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader;
ClientUtils.TryDeserialize<string>(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString);
Utf8JsonReader utf8JsonReaderString = utf8JsonReader;
ClientUtils.TryDeserialize<string>(ref utf8JsonReaderString, jsonSerializerOptions, out varString);

Utf8JsonReader utf8JsonReaderObject = utf8JsonReader;
ClientUtils.TryDeserialize<Object>(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ public partial class OneOfString : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="OneOfString" /> class.
/// </summary>
/// <param name="varString"></param>
internal OneOfString(string varString)
/// <param name="string"></param>
internal OneOfString(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

partial void OnCreated();

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string? VarString { get; set; }
public string? String { get; set; }

/// <summary>
/// Gets or Sets additional properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ public partial class PolymorphicProperty : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varBool"></param>
internal PolymorphicProperty(bool varBool)
/// <param name="bool"></param>
internal PolymorphicProperty(bool @bool)
{
VarBool = varBool;
Bool = @bool;
OnCreated();
}

/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varString"></param>
internal PolymorphicProperty(string varString)
/// <param name="string"></param>
internal PolymorphicProperty(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

Expand All @@ -74,14 +74,14 @@ internal PolymorphicProperty(List<string> list)
partial void OnCreated();

/// <summary>
/// Gets or Sets VarBool
/// Gets or Sets Bool
/// </summary>
public bool? VarBool { get; set; }
public bool? Bool { get; set; }

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string? VarString { get; set; }
public string? String { get; set; }

/// <summary>
/// Gets or Sets Object
Expand Down Expand Up @@ -161,11 +161,11 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type

if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1)
{
Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool);
Utf8JsonReader utf8JsonReaderBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool);

Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader;
ClientUtils.TryDeserialize<string?>(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString);
Utf8JsonReader utf8JsonReaderString = utf8JsonReader;
ClientUtils.TryDeserialize<string?>(ref utf8JsonReaderString, jsonSerializerOptions, out varString);

Utf8JsonReader utf8JsonReaderObject = utf8JsonReader;
ClientUtils.TryDeserialize<Object?>(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public partial class OneOfString : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="OneOfString" /> class.
/// </summary>
/// <param name="varString"></param>
internal OneOfString(string varString)
/// <param name="string"></param>
internal OneOfString(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

partial void OnCreated();

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string VarString { get; set; }
public string String { get; set; }

/// <summary>
/// Gets or Sets additional properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ public partial class PolymorphicProperty : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varBool"></param>
internal PolymorphicProperty(bool varBool)
/// <param name="bool"></param>
internal PolymorphicProperty(bool @bool)
{
VarBool = varBool;
Bool = @bool;
OnCreated();
}

/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varString"></param>
internal PolymorphicProperty(string varString)
/// <param name="string"></param>
internal PolymorphicProperty(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

Expand All @@ -72,14 +72,14 @@ internal PolymorphicProperty(List<string> list)
partial void OnCreated();

/// <summary>
/// Gets or Sets VarBool
/// Gets or Sets Bool
/// </summary>
public bool? VarBool { get; set; }
public bool? Bool { get; set; }

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string VarString { get; set; }
public string String { get; set; }

/// <summary>
/// Gets or Sets Object
Expand Down Expand Up @@ -159,11 +159,11 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type

if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1)
{
Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool);
Utf8JsonReader utf8JsonReaderBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool);

Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader;
ClientUtils.TryDeserialize<string>(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString);
Utf8JsonReader utf8JsonReaderString = utf8JsonReader;
ClientUtils.TryDeserialize<string>(ref utf8JsonReaderString, jsonSerializerOptions, out varString);

Utf8JsonReader utf8JsonReaderObject = utf8JsonReader;
ClientUtils.TryDeserialize<Object>(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public partial class OneOfString : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="OneOfString" /> class.
/// </summary>
/// <param name="varString"></param>
internal OneOfString(string varString)
/// <param name="string"></param>
internal OneOfString(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

partial void OnCreated();

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string? VarString { get; set; }
public string? String { get; set; }

/// <summary>
/// Gets or Sets additional properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ public partial class PolymorphicProperty : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varBool"></param>
internal PolymorphicProperty(bool varBool)
/// <param name="bool"></param>
internal PolymorphicProperty(bool @bool)
{
VarBool = varBool;
Bool = @bool;
OnCreated();
}

/// <summary>
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
/// </summary>
/// <param name="varString"></param>
internal PolymorphicProperty(string varString)
/// <param name="string"></param>
internal PolymorphicProperty(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

Expand All @@ -75,14 +75,14 @@ internal PolymorphicProperty(List<string> list)
partial void OnCreated();

/// <summary>
/// Gets or Sets VarBool
/// Gets or Sets Bool
/// </summary>
public bool? VarBool { get; set; }
public bool? Bool { get; set; }

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string? VarString { get; set; }
public string? String { get; set; }

/// <summary>
/// Gets or Sets Object
Expand Down Expand Up @@ -162,11 +162,11 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type

if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1)
{
Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool);
Utf8JsonReader utf8JsonReaderBool = utf8JsonReader;
ClientUtils.TryDeserialize<bool?>(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool);

Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader;
ClientUtils.TryDeserialize<string?>(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString);
Utf8JsonReader utf8JsonReaderString = utf8JsonReader;
ClientUtils.TryDeserialize<string?>(ref utf8JsonReaderString, jsonSerializerOptions, out varString);

Utf8JsonReader utf8JsonReaderObject = utf8JsonReader;
ClientUtils.TryDeserialize<Object?>(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public partial class OneOfString : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="OneOfString" /> class.
/// </summary>
/// <param name="varString"></param>
internal OneOfString(string varString)
/// <param name="string"></param>
internal OneOfString(string @string)
{
VarString = varString;
String = @string;
OnCreated();
}

partial void OnCreated();

/// <summary>
/// Gets or Sets VarString
/// Gets or Sets String
/// </summary>
public string VarString { get; set; }
public string String { get; set; }

/// <summary>
/// Gets or Sets additional properties
Expand Down
Loading
Loading