Generate strongly typed C# and TypeScript client codes from Open API / Swagger definitions supporting jQuery, Angular, AXIOS, Fetch API, Aurelia and Angular Strictly Typed Forms
MIT License
Bot releases are visible (Hide)
Published by zijianhuang over 2 years ago
New settings:
Published by zijianhuang over 2 years ago
Published by zijianhuang over 2 years ago
Map Date to DateOnly of .NET 6. Please also refer to https://www.codeproject.com/Articles/5325820/DateOnly-in-NET-6-and-ASP-NET-Core-6
Published by zijianhuang over 3 years ago
public enum ArrayAsIEnumerableDerived
{
Array,
IEnumerable,
IList,
ICollection,
IReadOnlyList,
IReadOnlyCollection,
List,
Collection,
ReadOnlyCollection,
}
based on https://github.com/zijianhuang/openapiclientgen/pull/33
Published by zijianhuang over 3 years ago
Mostly based on PR by Kim-SSi, introducing extended features for various contexts of application developments.
/// <summary>
/// Generated data types will be decorated with JsonProperty with the PropertyName in C#.
/// </summary>
public bool DecorateDataModelWithPropertyName { get; set; }
/// <summary>
/// OpenApClinetGent declares all value type properties including enum properties as nullable by default in generated C#, and all properties as nullable by default in generated TypeScript codes, unless the property is required.
/// This is to prevent serializer from creating payload for properties not assigned.
/// There might be situations in which you don't want such default features and want the codegen to respect OpenApi v3 option nullable. Then turn this setting to true, which affects generated C# codes only.
/// Please note, Some Open API definition files do not define nullable for some premitive types and enum, however, the respective backends do not expect some properties presented in the payload of the request.
/// therefore you need to build some integration test suites to find out what the backend would like.
/// If the YAML file defines a reference type property as nullable, the codegen ignores this setting since in C# a nullable reference type property is invalid.
/// </summary>
public bool DisableSystemNullableByDefault { get; set; }
/// <summary>
/// Use T? instead of System.Nullable<T> for value types, while by default System.Nullable<T> is used. C# 2.0 feature
/// </summary>
public bool UseNullableQuestionMark { get; set; }
/// <summary>
/// Use T? for reference types. C# 8.0 feature: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-reference-types
/// https://docs.microsoft.com/en-us/dotnet/csharp/nullable-migration-strategies: The global nullable context does not apply for generated code files.
/// Therefore it is up to you application programmers to make the compiler recognize the generated file is not generated.
/// Check test case: Test_vimeo()
/// </summary>
public bool UseNullableReferenceType { get; set; }
/// <summary>
/// Create the Model classes only
/// </summary>
public bool GenerateModelsOnly { get; set; }
/// <summary>
/// By default, array type will be array in generated C#. You may generated IEnumerable and some of its derived types.
/// </summary>
public ArrayAsIEnumerableDerived ArrayAs { get; set; }
If the generated codes is based on setting EnumToString, the serialization supports both [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] and [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]. And WebApiClientGen v5.2 supports theses converters, thus this is handy if generated codes by OpenApiclientGen is used in a service broker on .NET or .NET Framework, and you generate client API codes using WebApiClientGen.
Published by zijianhuang over 3 years ago
in C#. Generated TypeScript codes had been that way since day 1.
Published by zijianhuang over 3 years ago
Published by zijianhuang over 3 years ago
Published by zijianhuang about 4 years ago
minor bug fixes in DataContractAttribute namespace
Published by zijianhuang about 4 years ago
Published by zijianhuang over 4 years ago
Published by zijianhuang over 4 years ago
Published by zijianhuang over 4 years ago
Plugins cover Angular 5+, Aurelia, AXIOS, Fetch API and jQuery.
Published by zijianhuang over 4 years ago
Plugins cover Angular, Aurelia, AXIOS, Fetch API and jQuery.
Published by zijianhuang over 4 years ago
You may checkout the latest release tag and build for yourself.