[nancyfx] fix interface prefix (#6595)

* Retrofit2: Return ResponseBody if response if file.

Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.

New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.

* fix Interface Prefix
This commit is contained in:
craffael 2017-10-03 09:14:28 +02:00 committed by wing328
parent 28a5b74dbf
commit 1896e96648
3 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ namespace {{packageName}}.{{packageContext}}.Modules
/// Sets up HTTP methods mappings. /// Sets up HTTP methods mappings.
/// </summary> /// </summary>
/// <param name="service">Service handling requests</param> /// <param name="service">Service handling requests</param>
public {{classname}}Module({{classname}}Service service) : base("{{{baseContext}}}") public {{classname}}Module({{interfacePrefix}}{{classname}}Service service) : base("{{{baseContext}}}")
{ {{#operation}} { {{#operation}}
{{httpMethod}}["{{{path}}}"] = parameters => {{httpMethod}}["{{{path}}}"] = parameters =>
{ {

View File

@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
VisualStudioVersion = 12.0.0.0 VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1 MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{19B8107D-38E2-4D32-B74F-C45470A9FCA3}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}</ProjectGuid> <ProjectGuid>{19B8107D-38E2-4D32-B74F-C45470A9FCA3}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IO.Swagger.v2</RootNamespace> <RootNamespace>IO.Swagger.v2</RootNamespace>