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

Template directoy location in temp files #5126

Open
florisschild opened this issue Mar 24, 2025 · 0 comments
Open

Template directoy location in temp files #5126

florisschild opened this issue Mar 24, 2025 · 0 comments

Comments

@florisschild
Copy link

florisschild commented Mar 24, 2025

Describe the bug

When i set the Template directoy as '.\Templates' it ends up in my temp folder: %appdata%\Local\Temp\Templates.

As custom templates are not something i describe as temporary, I would expect is to take me somwhere less temp.

Version of NSwag toolchain, computer and .NET runtime used

V 14.2.0.0 of NSwagStudio

To Reproduce

  1. In NSwagStudio, set the field 'Template directoy' in 'CSharp Client' to '.\Templates'.
  2. Click 'Generate Files'
  3. Observe an error message: The template directory %appdata%\Local\Temp\Templates does not exist

NOTE: the bug is NOT that the directory does not exist. I know that. The issue here is the unexpected location the path is taking me.

Expected behavior

I expect the template location to end up in a less temporary place when using relative paths. The preffered behavoiur would be that it takes the path relative to the nswag json file, similar to the 'Output file path' field

Additional context

I want to make project specific template files and want them to be placed close by the nswag json. With the current implementation i only have the option to use absolute paths or relative paths to the temp folder. Both are not workable because when someone else uses the project, i cant guarantee the path exists on their machine

EDIT: I can implement the change if needed, but would like to have a clear description on the specification/expected behaviour. Also it could be a breaking change, so some guidence there would also be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant