-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add XmlCommentGenerator example and documentation #429
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
|
|
||
| { | ||
| "$schema": "https://aka.ms/codetour-schema", | ||
| "title": "XmlCommentGenerator", | ||
| "steps": | ||
| [ | ||
| { | ||
| "file": "rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj", | ||
| "description": "First, we add Nuget [Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/) in csproj ", | ||
| "pattern": "Microsoft.AspNetCore.OpenApi" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs", | ||
| "description": "File Program.cs \r\n>> dotnet run --project rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
|
|
||
| ,{ | ||
| "file": "rscg_examples/XmlCommentGenerator/src/TestProgram/obj/GX/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs", | ||
| "description": "Generated File 1 from 1 : OpenApiXmlCommentSupport.generated.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ], | ||
|
|
||
| "ref": "main" | ||
|
|
||
| } | ||
|
Comment on lines
+5
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# List all .tour files to understand the structure
find . -name "*.tour" -type f | head -20Repository: ignatandrei/RSCG_Examples Length of output: 1214 🏁 Script executed: #!/bin/bash
# Check the specific Program.cs file mentioned
if [ -f "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs" ]; then
echo "=== File exists at v2/ path ==="
wc -l "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
cat -n "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
elif [ -f "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs" ]; then
echo "=== File exists at rscg_examples/ path (no v2) ==="
wc -l "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
cat -n "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
else
echo "=== File not found at either path ==="
fiRepository: ignatandrei/RSCG_Examples Length of output: 1856 🏁 Script executed: #!/bin/bash
# Check another .tour file to see path convention
if [ -f "v2/.tours" ]; then
ls -la v2/.tours/ | head -10
echo ""
echo "=== Checking a sample .tour file for path convention ==="
find v2/.tours -name "*.tour" -type f | head -1 | xargs head -30
fiRepository: ignatandrei/RSCG_Examples Length of output: 51 🏁 Script executed: #!/bin/bash
# Read the XmlCommentGenerator.tour file
echo "=== XmlCommentGenerator.tour content ==="
cat v2/.tours/XmlCommentGenerator.tour
echo ""
echo "=== Program.tour (sample top-level tour) ==="
head -40 v2/.tours/Program.tour
echo ""
echo "=== TUnit.tour (another sample top-level tour) ==="
head -40 v2/.tours/TUnit.tourRepository: ignatandrei/RSCG_Examples Length of output: 3958 🏁 Script executed: #!/bin/bash
# Check a nested tour file for comparison
echo "=== Sample nested tour file for path convention ==="
head -40 v2/rscg_examples/ActorSrcGen/src/.tours/ActorSrcGen.tourRepository: ignatandrei/RSCG_Examples Length of output: 1161 The pattern issue is systemic across all .tour files; path convention is correct The review's concern about paths is incorrect. All top-level However, the pattern issue is valid but far broader than stated: The string Recommendation: The pattern should be replaced with an actual code snippet from the respective file (e.g., |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
|
|
||
| <h1>RSCG nr 240 : XmlCommentGenerator</h1> | ||
|
|
||
| <h2>Info</h2> | ||
| Nuget : <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/</a> | ||
|
|
||
| <p>You can find more details at : <a href="https://dotnet.microsoft.com/en-us/apps/aspnet" target="_blank"> https://dotnet.microsoft.com/en-us/apps/aspnet</a></p> | ||
|
|
||
| <p>Author :Microsoft</p> | ||
|
|
||
| <p>Source: <a href="https://github.com/dotnet/dotnet/" target="_blank">https://github.com/dotnet/dotnet/</a> </p> | ||
|
|
||
| <h2>About</h2> | ||
|
|
||
| Adding Xml comments to generated OpenAPI documentation | ||
|
|
||
| <h2> | ||
| How to use | ||
| </h2> | ||
| <h3> | ||
| Add reference to the <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">XmlCommentGenerator</a> in the csproj | ||
| </h3> | ||
| <img src="images/XmlCommentGenerator/TestProgram.csproj.png" width="580" height="580" /> | ||
|
|
||
| <h3>This was for me the <b>starting</b> code</h3> | ||
|
|
||
| <br /> | ||
| I have <b>coded</b> the file Program.cs | ||
| <br /> | ||
| <img src="images/XmlCommentGenerator/csFiles/Program.cs.png" width="580" height="580" /> | ||
| <hr /> | ||
| <h3>And here are the <i>generated</i> files</h3> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is OpenApiXmlCommentSupport.generated.cs | ||
| <br /> | ||
| <img src="images/XmlCommentGenerator/generated/OpenApiXmlCommentSupport.generated.cs.png" width="580" height="580" /> | ||
|
|
||
| <p> | ||
| You can download the code and this page as pdf from | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator | ||
| </a> | ||
| </p> | ||
|
|
||
|
|
||
| <p> | ||
| You can see the whole list at | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG | ||
| </a> | ||
| </p> | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "generator":{ | ||||||||||||||||||
| "name":"XmlCommentGenerator", | ||||||||||||||||||
| "nuget":[ | ||||||||||||||||||
| "https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" | ||||||||||||||||||
| ], | ||||||||||||||||||
| "link":"https://dotnet.microsoft.com/en-us/apps/aspnet", | ||||||||||||||||||
| "author":"Microsoft", | ||||||||||||||||||
| "source":"https://github.com/dotnet/dotnet/" | ||||||||||||||||||
| }, | ||||||||||||||||||
| "data":{ | ||||||||||||||||||
| "goodFor":["Adding Xml comments to generated OpenAPI documentation"], | ||||||||||||||||||
| "csprojDemo":"TestProgram.csproj", | ||||||||||||||||||
| "csFiles":["Program.cs"], | ||||||||||||||||||
| "excludeDirectoryGenerated":["Microsoft.AspNetCore.App.SourceGenerators", | ||||||||||||||||||
| "Microsoft.AspNetCore.Http.RequestDelegateGenerator", | ||||||||||||||||||
| "System.Text.Json.SourceGeneration"], | ||||||||||||||||||
|
Comment on lines
+15
to
+17
|
||||||||||||||||||
| "excludeDirectoryGenerated":["Microsoft.AspNetCore.App.SourceGenerators", | |
| "Microsoft.AspNetCore.Http.RequestDelegateGenerator", | |
| "System.Text.Json.SourceGeneration"], | |
| "excludeDirectoryGenerated":[ | |
| "Microsoft.AspNetCore.App.SourceGenerators", | |
| "Microsoft.AspNetCore.Http.RequestDelegateGenerator", | |
| "System.Text.Json.SourceGeneration" | |
| ], |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations. | ||
|
|
||
| This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436 |
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.
The
patternproperty value "this is the code" does not match any actual code in Program.cs. This pattern is used for CodeTour navigation and should match actual code text in the file, such as "using System.Text.Json.Serialization" or another distinctive line from the file.