Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Unable to pass null values to a method parameters in service-proxies.ts after nswag. #10529


User avatar
0
omkarchoudhari created

Prerequisites

  • What is your product version : - ANZ 10.4.0
  • What is your product type (Angular or MVC) : Angular
  • What is product framework type (.net framework or .net core) : .net core

Hi ANZ ,

I have recently upgraded ANZ template version to 10.4.0, After running nswag command template updates the methods in service-proxies and then it shows an errors to accept null values in methods arguments available in service-proxies.ts file. Can you please let me know what I am missing? is this is a bug or a feature introduced in latest version?


3 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @omkarchoudhari Can you please provide your project previous version? Also can you please share the relavent code part in service-proxies.

  • User Avatar
    0
    omkarchoudhari created

    hi @musa.demir

    Project previous version was ANZ 10.2.0. please find below attached screenshots. First attached screenshot is taken before running nswag command and it displays a method where it accepts arguments with null values.

    below attached is the screenshot of the same method after running nswag where nswag has removed the "| null" from method arguments.

    This is the case with every method in the service-proxies.ts where methods arguments are not accepting null values.

  • User Avatar
    0
    musa.demir created

    Hi @omkarchoudhari

    We regularly update our packages to latest versions. We updated nswag version recently see blame: https://github.com/aspnetzero/aspnet-zero-core/blame/dev/angular/package.json. And we found an issue with similar problem https://github.com/RicoSuter/NSwag/issues/3258. https://github.com/RicoSuter/NSwag/issues/3258