Skip to content

Commit

Permalink
v7.2.1 ready to release
Browse files Browse the repository at this point in the history
  • Loading branch information
zijianhuang committed Mar 1, 2024
1 parent 66a34d8 commit 5815d53
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 39 deletions.
6 changes: 6 additions & 0 deletions DemoCoreWeb.ClientApi/WebApiClientAuto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7491,6 +7491,9 @@ public bool PostInt2DJagged(int[][] a, Action<System.Net.Http.Headers.HttpReques
/// Demo int[]
/// POST api/SuperDemo/intArray
/// </summary>
/// <param name="a">Min length: 1
/// Max length: 10
/// </param>
public async Task<bool> PostIntArrayAsync(int[] a, Action<System.Net.Http.Headers.HttpRequestHeaders> handleHeaders = null)
{
var requestUri = "api/SuperDemo/intArray";
Expand Down Expand Up @@ -7519,6 +7522,9 @@ public async Task<bool> PostIntArrayAsync(int[] a, Action<System.Net.Http.Header
/// Demo int[]
/// POST api/SuperDemo/intArray
/// </summary>
/// <param name="a">Min length: 1
/// Max length: 10
/// </param>
public bool PostIntArray(int[] a, Action<System.Net.Http.Headers.HttpRequestHeaders> handleHeaders = null)
{
var requestUri = "api/SuperDemo/intArray";
Expand Down
3 changes: 2 additions & 1 deletion DemoCoreWeb/Controllers/SuperDemoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -288,7 +289,7 @@ public bool PostInt2DJagged([FromBody] int[][] a)
/// <returns></returns>
[HttpPost]
[Route("intArray")]
public bool PostIntArray([FromBody] int[] a)
public bool PostIntArray([FromBody, MinLength(1), MaxLength(10)] int[] a)
{
return a[7] == 8;
}
Expand Down
2 changes: 2 additions & 0 deletions DemoCoreWeb/Scripts/ClientApi/WebApiCoreJQClientAuto.js
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,8 @@ var DemoWebApi_Controllers_Client;
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a, callback, headersHandler) {
this.httpClient.post(this.baseUri + 'api/SuperDemo/intArray', a, callback, this.error, this.statusCode, 'application/json;charset=UTF-8', headersHandler);
Expand Down
2 changes: 2 additions & 0 deletions DemoCoreWeb/Scripts/ClientApi/WebApiCoreJQClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,8 @@ namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a: Array<number> | null, callback: (data : boolean) => any, headersHandler?: () => {[header: string]: string}) {
this.httpClient.post(this.baseUri + 'api/SuperDemo/intArray', a, callback, this.error, this.statusCode, 'application/json;charset=UTF-8', headersHandler);
Expand Down
2 changes: 1 addition & 1 deletion Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>3.5.1</Version>
<Version>3.5.2</Version>
<Authors>Zijian Huang</Authors>
<Company />
<Copyright>Copyright © Zijian Huang 2015-2024</Copyright>
Expand Down
2 changes: 2 additions & 0 deletions HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,8 @@ export namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a?: Array<number> | null, headersHandler?: () => HttpHeaders): Observable<boolean> {
return this.http.post<boolean>(this.baseUri + 'api/SuperDemo/intArray', JSON.stringify(a), { headers: headersHandler ? headersHandler().append('Content-Type', 'application/json;charset=UTF-8') : new HttpHeaders({ 'Content-Type': 'application/json;charset=UTF-8' }) });
Expand Down
2 changes: 2 additions & 0 deletions HeroesDemo/src/clientapi/WebApiCoreNg2ClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,8 @@ export namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a?: Array<number> | null, headersHandler?: () => HttpHeaders): Observable<boolean> {
return this.http.post<boolean>(this.baseUri + 'api/SuperDemo/intArray', JSON.stringify(a), { headers: headersHandler ? headersHandler().append('Content-Type', 'application/json;charset=UTF-8') : new HttpHeaders({ 'Content-Type': 'application/json;charset=UTF-8' }) });
Expand Down
2 changes: 1 addition & 1 deletion Poco2TsCore/Poco2TsCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.5</Version>
<Version>1.5.1</Version>
<PackageReleaseNotes>Build for .NET 7</PackageReleaseNotes>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
27 changes: 0 additions & 27 deletions WebApiClientGenCore.Abstract/Poco2CsGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -759,33 +759,6 @@ string[] GenerateCommentsFromAttributes(MemberInfo memberInfo)
}

return CommentsHelper.GenerateCommentsFromAttributes(memberInfo.GetCustomAttributes().ToList(), attribueCommentDic);

//List<string> ss = new();
//var attributes = memberInfo.GetCustomAttributes().ToList();
//attributes.Sort((x, y) =>
//{
// // Special-case RequiredAttribute so that it shows up on top
// if (x is RequiredAttribute)
// {
// return -1;
// }
// if (y is RequiredAttribute)
// {
// return 1;
// }

// return 0;
//});

//foreach (Attribute attribute in attributes)
//{
// if (attribueCommentDic.TryGetValue(attribute.GetType(), out Func<object, string> textGenerator))
// {
// ss.Add(textGenerator(attribute));
// }
//}

//return ss.ToArray();
}

void AddValidationAttributes(MemberInfo memberInfo, CodeTypeMember codeTypeMember, bool requiredAdded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<Copyright>Copyright © Zijian Huang 2015-2024</Copyright>
<Authors>Zijian Huang</Authors>
<PackageProjectUrl>https://github.com/zijianhuang/webapiclientgen</PackageProjectUrl>
<Version>2.9</Version>
<Version>2.9.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>Build for .NET 7</PackageReleaseNotes>
<PackageReleaseNotes>TypeScriptCodeDom v3.1; Generated doc comments from type and validation attributes for API parameters.</PackageReleaseNotes>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<NoWarn>1701;1702;IDE0057</NoWarn>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.Aurelia</AssemblyName>
<Version>3.6</Version>
<Version>3.6.1</Version>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.Axios</AssemblyName>
<Version>3.7</Version>
<Version>3.7.1</Version>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Authors>Zijian Huang</Authors>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>3.7</Version>
<Version>3.7.1</Version>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.NG2</AssemblyName>
<Version>3.8</Version>
<Version>3.8.1</Version>
<PackageTags>Angular</PackageTags>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.NG2FormGroup</AssemblyName>
<Version>1.5.1</Version>
<Version>1.5.2</Version>
<PackageTags>Angular</PackageTags>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.jQuery</AssemblyName>
<Version>3.5</Version>
<Version>3.5.1</Version>
<PackageTags>jQuery</PackageTags>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
Expand Down
3 changes: 2 additions & 1 deletion WebApiClientGenCore/WebApiClientGenCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RootNamespace>Fonlow.CodeDom.Web</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>Fonlow.WebApiClientGenCore</PackageId>
<Version>7.2</Version>
<Version>7.2.1</Version>
<Description>Generate strongly typed client API in C# or TypeScript for .NET Core Web API. Strongly Typed Client API Generator generates C# and TypeScript codes of strongly typed client API similar to what generated by SvcUtil.exe of WCF, provided you have access to the ASP.NET Web API source codes or assemblies. Then you may provide or publish either the source codes in C# and TypeScript or the compiled client API library to other developers who are developing client programs of your Web API. The TypeScript outputs support jQuery, Angular 2+, AXIOS and Aurelia.</Description>
<Copyright>Copyright © Zijian Huang 2015-2024</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
Expand All @@ -15,6 +15,7 @@
With TypeScript CodeDOM v3.2. Better handling of integral numbers larger than 53bit. Good supports for integral types of .NET: Int64, UInt64, Int128, UInt128, BigInteger, through Fonlow.TypeScriptCodeDOMCore.
Generated doc comments for class properties of integral types, which will be translated to JavaScript number or string, if respective properties have no doc comment declared in XML doc comment and have no validation attributes. Supported through Fonlow.Poco2TsCore.
Generated doc comments for API function parameters and return of integral types, if respective parameters have no doc comment declared in XML doc comment.
TypeScriptCodeDom v3.1; Generated doc comments from type and validation attributes for API parameters.
</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<NeutralLanguage>en</NeutralLanguage>
Expand Down
2 changes: 2 additions & 0 deletions aurelia/src/clientapi/WebApiCoreAureliaClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,8 @@ export namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a: Array<number> | null, headersHandler?: () => {[header: string]: string}): Promise<boolean> {
return this.http.post('api/SuperDemo/intArray', JSON.stringify(a), { headers: headersHandler ? Object.assign(headersHandler(), { 'Content-Type': 'application/json;charset=UTF-8' }): { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => d.json());
Expand Down
2 changes: 2 additions & 0 deletions axios/src/clientapi/WebApiCoreAxiosClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,8 @@ export namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a: Array<number> | null, headersHandler?: () => {[header: string]: string}): Promise<boolean> {
return Axios.post<boolean>(this.baseUri + 'api/SuperDemo/intArray', JSON.stringify(a), { headers: headersHandler ? Object.assign(headersHandler(), { 'Content-Type': 'application/json;charset=UTF-8' }): { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => d.data);
Expand Down
2 changes: 2 additions & 0 deletions fetchapi/src/clientapi/WebApiCoreFetchClientAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,8 @@ export namespace DemoWebApi_Controllers_Client {
/**
* Demo int[]
* POST api/SuperDemo/intArray
* @param {Array<number>} a Min length: 1
* Max length: 10
*/
postIntArray(a?: Array<number> | null, headersHandler?: () => {[header: string]: string}): Promise<boolean> {
return fetch(this.baseUri + 'api/SuperDemo/intArray', { method: 'post', headers: headersHandler ? Object.assign(headersHandler(), { 'Content-Type': 'application/json;charset=UTF-8' }): { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(a) }).then(d => d.json());
Expand Down

0 comments on commit 5815d53

Please sign in to comment.