Base solution for your next web application
Open Closed

NSwag Angular project generate error proxy #4370


User avatar
0
khai created

Hello Volosoft team,

After I made some API, I want to generate the proxies for Angular. I used refresh.bat in nswag folder and open file service.config.nswag to change the URL (only change that line and saved).

When I run the refresh.bat, the generator runs well. But when I opened the file, I see many lines have similar to this: "ListResultDto`1OfOfFlatPermissionWithLevelDtoAndSharedAnd_0AndCulture=neutralAndPublicKeyToken=null" and this make error in NPM Start.

Included in this topic are

Please help me, because my deadline is very soon from now. Thanks


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Khai,

    can you share your swagger json specification ? Does this work if you don't change the url ?

  • User Avatar
    0
    khai created

    Here is my Swagger.json file: <a class="postlink" href="https://gist.github.com/LAITRUNGMINHDUC/ad79f64e852049a11dbde274e5574b63">https://gist.github.com/LAITRUNGMINHDUC ... 74e5574b63</a>. This is the first time I generate the proxy file, and I just change the port of localhost to localhost:5000.

  • User Avatar
    0
    khai created

    I figured out what just happened to my code. I added the: options.CustomSchemaIds(x => x.FullName); to fix the other problems according to <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2663">https://github.com/aspnetboilerplate/as ... ssues/2663</a>.

    My current solution is to change the class name of my viewmodel. But is there any other solution?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Khai,

    It seems like there is no decent solution for both problems right now. It is better to go with second option for you.