-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve support for empty and non-ASCII-alphabetic properties, enum v…
…alues, and definitions (#17) * TypeScript: Support invalid identifiers as properties * Try to fix bad name generation * Add support for empty and nonascii definitions/enums/properties
- Loading branch information
Showing
54 changed files
with
1,899 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/DefaultName.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(DefaultNameJsonConverter))] | ||
public class DefaultName | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class DefaultNameJsonConverter : JsonConverter<DefaultName> | ||
{ | ||
public override DefaultName Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new DefaultName { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, DefaultName value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/Foo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(FooJsonConverter))] | ||
public class Foo | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class FooJsonConverter : JsonConverter<Foo> | ||
{ | ||
public override Foo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new Foo { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, Foo value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/Foo0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(Foo0JsonConverter))] | ||
public class Foo0 | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class Foo0JsonConverter : JsonConverter<Foo0> | ||
{ | ||
public override Foo0 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new Foo0 { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, Foo0 value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/Foo0bar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(Foo0barJsonConverter))] | ||
public class Foo0bar | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class Foo0barJsonConverter : JsonConverter<Foo0bar> | ||
{ | ||
public override Foo0bar Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new Foo0bar { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, Foo0bar value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/Foo1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(Foo1JsonConverter))] | ||
public class Foo1 | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class Foo1JsonConverter : JsonConverter<Foo1> | ||
{ | ||
public override Foo1 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new Foo1 { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, Foo1 value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/FooBar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(FooBarJsonConverter))] | ||
public class FooBar | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class FooBarJsonConverter : JsonConverter<FooBar> | ||
{ | ||
public override FooBar Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new FooBar { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, FooBar value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/FooBar0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(FooBar0JsonConverter))] | ||
public class FooBar0 | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class FooBar0JsonConverter : JsonConverter<FooBar0> | ||
{ | ||
public override FooBar0 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new FooBar0 { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, FooBar0 value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/FooBar1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(FooBar1JsonConverter))] | ||
public class FooBar1 | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class FooBar1JsonConverter : JsonConverter<FooBar1> | ||
{ | ||
public override FooBar1 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new FooBar1 { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, FooBar1 value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/target_csharp_system_text/output/empty_and_nonascii_definitions/Root.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Code generated by jtd-codegen for C# + System.Text.Json v0.2.0 | ||
|
||
using System; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JtdCodegenE2E | ||
{ | ||
[JsonConverter(typeof(RootJsonConverter))] | ||
public class Root | ||
{ | ||
/// <summary> | ||
/// The underlying data being wrapped. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
|
||
public class RootJsonConverter : JsonConverter<Root> | ||
{ | ||
public override Root Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return new Root { Value = JsonSerializer.Deserialize<string>(ref reader, options) }; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, Root value, JsonSerializerOptions options) | ||
{ | ||
JsonSerializer.Serialize<string>(writer, value.Value, options); | ||
} | ||
} | ||
} |
Oops, something went wrong.