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

[bug] 关于ts代码生成的相关bug #34

Open
MJEdwin opened this issue Sep 17, 2023 · 0 comments
Open

[bug] 关于ts代码生成的相关bug #34

MJEdwin opened this issue Sep 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@MJEdwin
Copy link

MJEdwin commented Sep 17, 2023

  1. ts生成时没有考虑路由参数的匹配
[ApiController]
public class TestController
{
  [HttpGet("/Test/{id}")]
  public void Test(string id)
  {}
}
  1. ts生成时delete参数可能位于body上,代码中只考虑了query
public class Test
{
  public string Id{get;set;}
  public string Name{get;set;}
}
[ApiController]
public class TestController
{
  [HttpDelete("/Test")]
  public void Test(Test test)
  {}
}
  1. ts生成时url路由规则只可能为/{prefix}/{controllerName}/{actionName},但apicontroller也有可能为自定义路由形式
public class Test
{
  public string Id{get;set;}
  public string Name{get;set;}
}
[ApiController]
[Route("/api/[controller]")
public class TestController
{
  [HttpDelete("/Test")]
  public void Test(Test test)
  {}
}
  1. ts生成时query参数也可能为复杂类型,但该方法不支持生成
public class Test
{
  public string Id{get;set;}
  public string Name{get;set;}
}
[ApiController]
public class TestController
{
  [HttpGet("/Test")]
  public void Test([FromQuery]Test test)
  {}
}
@TimChen44 TimChen44 added the bug Something isn't working label Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants