-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ControllerBase is also generated #1535
Comments
small follow up. So, when i run my webapi core in the browser and go to the swagger page it does have to right swagger.json and when i use that one to generate my api service everything looks fine. So it goes wrong somewhere in the generation of the json trough the .net assembly. this is the json it generates from the assembly... it doesn't even have the values api?
|
Can you share the nswag config file? Maybe you’re using the api explorer based generator as middleware and the reflection based one in cli? |
hi, thx for answering. So, the only thing different from the instruction video (https://www.youtube.com/watch?v=lF9ZZ8p2Ciw&t=37s) is my startup class (see blow) and the fact that I have to make the publish selfcontained because otherwise i get this error "tem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. Startup Class
.nswag configuration.
and then when i can generate the spec i get the nasty spec from my initial posts. kind regards. |
ok, super, looks like this is working!! thank you so much! |
Hi, one more small follow up question... So everything is working fine until I add references to the project then I get this error when generating the files... Any idea what i need to add (or remove)? C:\Euromex.net\Euromex.ServiceHost\Euromex.ServiceHost.csproj(167,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.400\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. Kind regards, |
So this is with the new Api Explorer based generator? |
hi, yes, as long as i just use the application by itself its all going good and the moment I add a reference I get errors like this one? |
@roscoedeemarutam can you provide a sample project to repro this? I think you should create a new issue for this problem... |
ok! will do! |
ok, so... maybe not necessary anymore... It works when I put the nobuild checkbox in the project configuration!? |
Hmm if you run the generator as an msbuild task after the compilation, you should enable nobuild as the project is always built before the generator is running. |
yes, thats exaclty what we need to have a build task of the generator after compilation. So we'll go with the nobuild configuration. Anyway, thx again for the quick answers. |
hi,
I'm new to NSwag so please forgive my ignorance.
When I try to generate my basic scaffolded WebApi core project in visual studio, nswagstudio also generates the complete ControllerBase class, together with the ValuesController, which of course is not needed for an angular Api service (I expect only the ValuesController to be generated).. Can someone advise what i have to do so the generated swagger only contains my api classes and not the base class it inherits from, is this a setting in the nswag studio? Or am i not understanding something more fundamental here?
thx.
R
The text was updated successfully, but these errors were encountered: