Skip to content

Commit

Permalink
Add an extension point after C# class definition
Browse files Browse the repository at this point in the history
This makes it possible to generate code that knows the name of the
generated class.

(the practical use case I have is adding a method that would register
 several instances of the generated client (each with a different
 authentication method) in my DI)

Nb: an alternatives to this commit would be to leverage an extension
point in the File.liquid, but at this point the name of the generated
classes are not available
  • Loading branch information
gturri committed Mar 15, 2024
1 parent c0e16f9 commit f0f2d9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Empty file.
2 changes: 2 additions & 0 deletions src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,5 @@
{% template Client.Class.ConvertToString %}
{% template Client.Class.Body %}
}

{% template Client.Class.AfterDefinition %}

0 comments on commit f0f2d9d

Please sign in to comment.