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

DirectoryNotFoundException #76

Closed
christianhelle opened this issue Jun 20, 2023 · 0 comments · Fixed by #77
Closed

DirectoryNotFoundException #76

christianhelle opened this issue Jun 20, 2023 · 0 comments · Fixed by #77
Assignees
Labels
bug Something isn't working

Comments

@christianhelle
Copy link
Owner

Describe the bug
Code generation fails if the output folder doesn't exist

Support Key: ptbddgt

OpenAPI Specifications
https://petstore3.swagger.io/api/v3/openapi.json

Additional context:

$ refitter https://petstore3.swagger.io/api/v3/openapi.json --output ../Boom/Kaboom/GeneratedCode.cs

Exception message
Could not find a part of the path 'C:\Boom\Kaboom\GeneratedCode.cs'.

Stack trace

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Boom\Kaboom\GeneratedCode.cs'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(System.String fullPath, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options) at offset 161
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(System.String fullPath, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options, System.Int64 preallocationSize) at offset 6
at System.IO.Strategies.OSFileStreamStrategy..ctor(System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options, System.Int64 preallocationSize) at offset 49
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options, System.Int64 preallocationSize) at offset 24
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(System.IO.FileStream fileStream, System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.Int64 preallocationSize)
at System.IO.File.AsyncStreamWriter(System.String path, System.Text.Encoding encoding, System.Boolean append)
at System.IO.File.WriteAllTextAsync(System.String path, System.String contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken) at offset 85
at Refitter.GenerateCommand.<ExecuteAsync>d__1.MoveNext() at offset 397 in /home/runner/work/refitter/refitter/src/Refitter/GenerateCommand.cs:line 45:col 13

@christianhelle christianhelle added the bug Something isn't working label Jun 20, 2023
@christianhelle christianhelle self-assigned this Jun 20, 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

Successfully merging a pull request may close this issue.

1 participant