Skip to content

Commit

Permalink
Merge pull request #101 from NSwag/master
Browse files Browse the repository at this point in the history
Added xml gen
  • Loading branch information
RicoSuter committed May 12, 2016
2 parents 7baaad7 + 2e11a2a commit dad9b7d
Show file tree
Hide file tree
Showing 3 changed files with 581 additions and 574 deletions.
4 changes: 4 additions & 0 deletions src/NSwag.AssemblyLoader/NSwag.AssemblyLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\NSwag.AssemblyLoader.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,6 +31,8 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\NSwag.AssemblyLoader.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ private string GetHttpPath(SwaggerService service, SwaggerOperation operation, T
httpPath = routeAttribute.Template;
}
else
httpPath = Settings.DefaultUrlTemplate;

var actionName = GetActionName(method);
httpPath = httpPath
.Replace("{controller}", controllerType.Name.Replace("Controller", string.Empty))
.Replace("{action}", actionName);
{
var actionName = GetActionName(method);
httpPath = (Settings.DefaultUrlTemplate ?? string.Empty)
.Replace("{controller}", controllerType.Name.Replace("Controller", string.Empty))
.Replace("{action}", actionName);
}

foreach (var match in Regex.Matches(httpPath, "\\{(.*?)\\}").OfType<Match>())
{
Expand Down
Loading

0 comments on commit dad9b7d

Please sign in to comment.