-
Notifications
You must be signed in to change notification settings - Fork 57
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
#196 Publish a global dotnet tool (AsyncAPI.Saunter.Generator.Cli) #217
base: main
Are you sure you want to change the base?
#196 Publish a global dotnet tool (AsyncAPI.Saunter.Generator.Cli) #217
Conversation
|
||
# XML project files | ||
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] | ||
indent_size = 4 | ||
indent_size = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current files were using a size of 2 and lf line endings, so I changed it (because my VS defaults are different)
…uments, default all. Added support for env vars
…data to package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great decision, and you're well on your way, but the product is not yet ready for release to users.
src/AsyncAPI.Saunter.Generator.Cli/AsyncAPI.Saunter.Generator.Cli.csproj
Outdated
Show resolved
Hide resolved
test/AsyncAPI.Saunter.Generator.Cli.Tests/PackAndInstallLocalTests.cs
Outdated
Show resolved
Hide resolved
test/AsyncAPI.Saunter.Generator.Cli.Tests/DotnetCliToolTests.cs
Outdated
Show resolved
Hide resolved
I'm happy to comply with the new formatting style rules or with changes from PRs like #201 @yurvon-screamo is it possible to assign issues to me? #196 #197 #207 (Or can you assign rights if I may do that myself?) |
don't rush too much, I'm finishing the translation to the LEGO library, better wait for it so as not to solve a million conflicts... |
I didn't know you were working on the LEGO migration, just saw your draft PR. Very nice to see! If any more conflicts arise, I'll resolve them too. |
…Publish-a-global-dotnet-tool # Conflicts: # .github/workflows/ci.yaml # Saunter.sln
…achbuckle copy/paste code
I think all remarks have been addressed. All the working parts are unit tested. I've also made changes to the ci workflows to run all tests (not just the 2 projects that already existed.) and to also release based on the solution, not just the main Saunter csproj (release pipeline changes are not tested) |
…at failed to generate specs, fixed now. Added an external nuget dependancy to the example project (nlog) because that made spec generation fail, fixed now. And now also testing both .NET6 & .NET8
<PropertyGroup> | ||
<!-- This project is targeting .NET8 intentionally (The 'old school' Startup-class project is .NET6), to prove that | ||
the AsyncAPI.Saunter.Generator.Cli tool can generate specs for projects targetting .NET6 and .NET8. --> | ||
<TargetFramework>net8.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 2nd example project (also to be used in integration test) because Top Level Statement projects initially didn't work with the Generator.Cli tool. Now it does work too. And proves using integration test that both NET6 & NET8 targets work.
@yurvon-screamo Any idea when this might get merged and added? Would love to be able to use this tool. |
@smoerijf Your prerelease version on NuGet does not work with function apps. They do not have a standard Startup.cs file, and it seems to be having issues with that. |
Thank you for trying the prerelease. I've never worked with function apps, is that the same as Azure functions? Don't those apps have a Main or ServiceProvider? How this tools works: Inspect the DLL to find the main entrypoint and build the IServiceProvider. That IServiceProvider is used to create instances of Saunter's IAsyncApiDocumentProvider class. This is the same approach as Entity Framework Migrations (I'm using an EF nuget package to extract the IServiceProvider from the DLL). So this tool should support the same type of apps as EF does. As I've no experience at all with function apps, I've no idea how they are structured or how Saunter library integrates with them. If they work with EF migrations, could you share a (minimal) example with Saunter? |
Here's a minimal example: https://github.com/7CLewis/SaunterFunctionApp. If you Build that and then try to run Azure Function apps do not have a normal Startup like regular apps, as you can see from that example. I haven't tried EF Migrations with AzFuncs, so I can't speak to that. |
@smoerijf when u do ef core in AzF where startup doesn't exists you have to offer up a Design Time Factory as doc'd here https://learn.microsoft.com/en-us/ef/core/cli/dbcontext-creation?tabs=dotnet-core-cli#from-a-design-time-factory could something similar be done in saunter where before looking for startup stuff...it would look for a specific public type implementing an interface. |
Description
tool to generate an asyncApi spec from a startup assembly.
Implementation inspired by https://www.nuget.org/packages/Swashbuckle.AspNetCore.Cli
I already took the freedom to upload to nuget: https://www.nuget.org/packages/AsyncAPI.Saunter.Generator.Cli
Uses the Lego AsyncApi.net nuget packages to also export yml spec files.
Related issue(s)
#196