diff --git a/Rest.Net/ClientCodeGenerator.cs b/Rest.Net/ClientCodeGenerator.cs
index 5c92249..c12ecb1 100644
--- a/Rest.Net/ClientCodeGenerator.cs
+++ b/Rest.Net/ClientCodeGenerator.cs
@@ -327,6 +327,20 @@ namespace MontoyaTech.Rest.Net
///
public static string GenerateCSharpClient(List routes, string name = "Client")
{
+ //Remove any hidden routes from code generation.
+ for (int i = 0; i < routes.Count; i++)
+ {
+ var methodInfo = routes[i].GetTarget().GetMethodInfo();
+
+ var routeHidden = methodInfo.GetCustomAttribute();
+
+ if (routeHidden != null)
+ {
+ routes.RemoveAt(i);
+ i--;
+ }
+ }
+
var includedTypes = FindRoutesDependencies(routes);
var routeGroups = FindRouteGroups(routes);
diff --git a/Rest.Net/Rest.Net.csproj b/Rest.Net/Rest.Net.csproj
index 1afc87e..c02bef2 100644
--- a/Rest.Net/Rest.Net.csproj
+++ b/Rest.Net/Rest.Net.csproj
@@ -17,7 +17,7 @@
MontoyaTech.Rest.Net
MontoyaTech.Rest.Net
True
- 1.2.0
+ 1.2.1
Logo_Symbol_Black_Outline.png
diff --git a/Rest.Net/RouteHidden.cs b/Rest.Net/RouteHidden.cs
new file mode 100644
index 0000000..4043d83
--- /dev/null
+++ b/Rest.Net/RouteHidden.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MontoyaTech.Rest.Net
+{
+ ///
+ /// The outline of an Attribute to hide a given route for client code generation.
+ ///
+ [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
+ public class RouteHidden : Attribute
+ {
+ ///
+ /// Creates a default RouteHidden attribute.
+ ///
+ public RouteHidden() { }
+ }
+}