Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions bin/nancyfx-petstore-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"

if [ ! -f "$executable" ]
then
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/nancyfx -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nancyfx -o samples/server/petstore/nancyfx"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/windows/nancyfx-petstore-server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l nancyfx -o samples\server\petstore\nancyfx\
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l nancyfx -o samples\server\petstore\nancyfx\

java %JAVA_OPTS% -jar %executable% %ags%
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public Map<String, Object> postProcessAllModels(final Map<String, Object> models
}

private void postProcessParentModels(final Map<String, Object> models) {
log.info("Processing parents: " + parentModels);
log.debug("Processing parents: " + parentModels);
for (final String parent : parentModels) {
final CodegenModel parentModel = modelByName(parent, models);
parentModel.hasChildren = true;
Expand Down Expand Up @@ -301,7 +301,7 @@ public String toEnumVarName(final String name, final String datatype) {
} else {
result = enumName;
}
log.info(String.format("toEnumVarName('%s', %s) = '%s'", name, datatype, enumName));
log.debug(String.format("toEnumVarName('%s', %s) = '%s'", name, datatype, enumName));
return result;
}

Expand All @@ -313,7 +313,7 @@ public String toApiName(final String name) {
} else {
apiName = capitalize(name);
}
log.info(String.format("toApiName('%s') = '%s'", name, apiName));
log.debug(String.format("toApiName('%s') = '%s'", name, apiName));
return apiName;
}

Expand All @@ -334,7 +334,7 @@ public String toModelImport(final String name) {
} else {
result = null;
}
log.info(String.format("toModelImport('%s') = '%s'", name, result));
log.debug(String.format("toModelImport('%s') = '%s'", name, result));
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ namespace {{packageName}}.Client
/// <returns></returns>
public void AddDefaultHeader(string key, string value)
{
if (_defaultHeaderMap.ContainsKey(key))
_defaultHeaderMap.Remove(key);
_defaultHeaderMap.Add(key, value);
_defaultHeaderMap[key] = value;
}

/// <summary>
Expand All @@ -171,9 +169,7 @@ namespace {{packageName}}.Client
/// <returns></returns>
public void AddApiKey(string key, string value)
{
if (ApiKey.ContainsKey(key))
ApiKey.Remove(key);
ApiKey.Add(key, value);
ApiKey[key] = value;
}

/// <summary>
Expand All @@ -183,9 +179,7 @@ namespace {{packageName}}.Client
/// <param name="value">Api Key value.</param>
public void AddApiKeyPrefix(string key, string value)
{
if (ApiKeyPrefix.ContainsKey(key))
ApiKeyPrefix.Remove(key);
ApiKeyPrefix.Add(key, value);
ApiKeyPrefix[key] = value;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>{{packageName}}.{{packageContext}}</RootNamespace>
<AssemblyName>{{packageTitle}}</AssemblyName>
<AssemblyName>{{packageName}}</AssemblyName>
{{^supportsUWP}}
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
{{/supportsUWP}}
Expand Down
10 changes: 5 additions & 5 deletions samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{B7B26355-6F11-47C6-AB34-6237A673E486}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Expand All @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}.Release|Any CPU.Build.0 = Release|Any CPU
{B7B26355-6F11-47C6-AB34-6237A673E486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7B26355-6F11-47C6-AB34-6237A673E486}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7B26355-6F11-47C6-AB34-6237A673E486}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7B26355-6F11-47C6-AB34-6237A673E486}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
14 changes: 7 additions & 7 deletions samples/client/petstore/csharp/SwaggerClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c

- API version: 1.0.0
- SDK version: 1.0.0
- Build date: 2016-07-24T11:20:06.818-04:00
- Build date: 2016-07-26T00:22:48.731+08:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen

## Frameworks supported
Expand Down Expand Up @@ -137,6 +137,12 @@ Class | Method | HTTP request | Description

## Documentation for Authorization

### api_key

- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

### petstore_auth

- **Type**: OAuth
Expand All @@ -146,9 +152,3 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets

### api_key

- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ public Dictionary<String, String> DefaultHeader
/// <returns></returns>
public void AddDefaultHeader(string key, string value)
{
if (_defaultHeaderMap.ContainsKey(key))
_defaultHeaderMap.Remove(key);
_defaultHeaderMap.Add(key, value);
_defaultHeaderMap[key] = value;
}

/// <summary>
Expand All @@ -192,9 +190,7 @@ public void AddDefaultHeader(string key, string value)
/// <returns></returns>
public void AddApiKey(string key, string value)
{
if (ApiKey.ContainsKey(key))
ApiKey.Remove(key);
ApiKey.Add(key, value);
ApiKey[key] = value;
}

/// <summary>
Expand All @@ -204,9 +200,7 @@ public void AddApiKey(string key, string value)
/// <param name="value">Api Key value.</param>
public void AddApiKeyPrefix(string key, string value)
{
if (ApiKeyPrefix.ContainsKey(key))
ApiKeyPrefix.Remove(key);
ApiKeyPrefix.Add(key, value);
ApiKeyPrefix[key] = value;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1ABB7E18-6533-446C-9EEA-0E0839F5C12A}</ProjectGuid>
<ProjectGuid>{B7B26355-6F11-47C6-AB34-6237A673E486}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IO.Swagger</RootNamespace>
Expand Down
23 changes: 23 additions & 0 deletions samples/server/petstore/nancyfx/.swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
10 changes: 5 additions & 5 deletions samples/server/petstore/nancyfx/IO.Swagger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1DE2DD8D-1AFB-4BC2-9FB5-04DE7DCA1353}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{4E6FF76E-03ED-499F-B05C-4315904C488E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1DE2DD8D-1AFB-4BC2-9FB5-04DE7DCA1353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DE2DD8D-1AFB-4BC2-9FB5-04DE7DCA1353}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DE2DD8D-1AFB-4BC2-9FB5-04DE7DCA1353}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DE2DD8D-1AFB-4BC2-9FB5-04DE7DCA1353}.Release|Any CPU.Build.0 = Release|Any CPU
{4E6FF76E-03ED-499F-B05C-4315904C488E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E6FF76E-03ED-499F-B05C-4315904C488E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E6FF76E-03ED-499F-B05C-4315904C488E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E6FF76E-03ED-499F-B05C-4315904C488E}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Loading