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

Running 'refresh.bat' file NSwag gives Stack overflow error #12219


User avatar
0
OriAssurant created

After 13.1 merge to our current dev branch , we are getting Stack overflow error while running 'refresh.bat' file to update service-proxes.ts file

Anyone seen this kind of error before or any ideas on this error. Please suggest Thanks


7 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi OriAssurant

    If your model classes have circular references (e.g., a property in Class A references Class B, and Class B references Class A), NSwag may struggle to generate the schema. Try using [JsonIgnore] or [SwaggerIgnore] attributes on properties that create circular references.

  • User Avatar
    0
    OriAssurant created

    Thank you oguzhanagir-

    Any other causes you have seen for this issue? After checking for circular references, commenting out many of our custom classes, etc. the issue is still occurring.

    Asp.net Zero dropped the use of Newtonsoft in favor of System.Text.Json in v13 right? Seeing Newtonsoft.Json in the error we're getting.

    Any other ideas of what to check would be very much appreciated. Thanks

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @OriAssurant,

    Can you update the following code on your service.config.nswag

      "codeGenerators": {
        "openApiToCSharpClient": {
          "jsonLibrary": "SystemTextJson", // change this line
        }
    
  • User Avatar
    0
    OriAssurant created

    Unfortunately changing "jsonLibrary": "SystemTextJson" in service.config.nswag didn't resolve the issue. Now I can see new errors

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @OriAssurant,

    Could you share your project with [email protected] We can take a look for your custom services.

  • User Avatar
    0
    OriAssurant created

    Hi oguzhanagir Project shared with "[email protected]" .

    Please check and et us know if you are facing any access issue to get the shared project.

    Thank you

  • User Avatar
    0
    OriAssurant created

    Hi oguzhanagir, Hopefully your support received the shared project and taking a look.

    any ideas/clues regarding resolve the issue from our project would be very much appreciated.

    Thanks