You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, the Microsoft.Extensions.ApiDescription.Server package can be used to generate OpenAPI documentation that is "served statically from the web server".
However, as far as I can see, that doesn't happen.
The JSON file is generated in the obj folder by default. There doesn't seem to be any way to get it into the output folder, since $(OutDir) and $(OutputPath) are blank when the tool runs, and you get a build error if you try to use them:
MSB4184 The expression "[System.IO.Path]::GetFullPath('')" cannot be evaluated. The path is not of a legal form.
And even if you manually copy the generated JSON file into the correct place within the destination path, the request ignores it and generates the file again at runtime.
So the net result is that my build is slowed down by ~20s to generate a file which is never used.
Surely I must be missing something? Is there really no way to have the file generated at build-time into the correct folder, and then served statically at run-time?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
According to the documentation, the
Microsoft.Extensions.ApiDescription.Serverpackage can be used to generate OpenAPI documentation that is "served statically from the web server".However, as far as I can see, that doesn't happen.
The JSON file is generated in the
objfolder by default. There doesn't seem to be any way to get it into the output folder, since$(OutDir)and$(OutputPath)are blank when the tool runs, and you get a build error if you try to use them:And even if you manually copy the generated JSON file into the correct place within the destination path, the request ignores it and generates the file again at runtime.
So the net result is that my build is slowed down by ~20s to generate a file which is never used.
Surely I must be missing something? Is there really no way to have the file generated at build-time into the correct folder, and then served statically at run-time?
All reactions