Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix NancyFX string parser #4048

Merged
merged 2 commits into from
Oct 22, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace {{packageName}}.{{packageContext}}.Utils
private static IDictionary<Type, Func<Parameter, object>> CreateParsers()
{
var parsers = ImmutableDictionary.CreateBuilder<Type, Func<Parameter, object>>();
parsers.Put(typeof(string), value => value);
parsers.Put(typeof(string), value => value.Value);
parsers.Put(typeof(bool), SafeParse(bool.Parse));
parsers.Put(typeof(bool?), SafeParse(bool.Parse));
parsers.Put(typeof(byte), SafeParse(byte.Parse));
Expand Down Expand Up @@ -411,4 +411,4 @@ namespace {{packageName}}.{{packageContext}}.Utils
Path,
Header
}
}
}
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", "{D198220E-91F6-402F-966F-8EF6105B1B75}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D198220E-91F6-402F-966F-8EF6105B1B75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D198220E-91F6-402F-966F-8EF6105B1B75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D198220E-91F6-402F-966F-8EF6105B1B75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D198220E-91F6-402F-966F-8EF6105B1B75}.Release|Any CPU.Build.0 = Release|Any CPU
{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}.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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D198220E-91F6-402F-966F-8EF6105B1B75}</ProjectGuid>
<ProjectGuid>{1CE943E7-586D-4D9C-BE8B-3E005FDC39D1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IO.Swagger.v2</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// ApiResponse
/// Describes the result of uploading an image resource
/// </summary>
public sealed class ApiResponse: IEquatable<ApiResponse>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// Category
/// A category for a pet
/// </summary>
public sealed class Category: IEquatable<Category>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// Order
/// An order for a pets from the pet store
/// </summary>
public sealed class Order: IEquatable<Order>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// Pet
/// A pet for sale in the pet store
/// </summary>
public sealed class Pet: IEquatable<Pet>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// Tag
/// A tag for a pet
/// </summary>
public sealed class Tag: IEquatable<Tag>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace IO.Swagger.v2.Models
{
/// <summary>
/// User
/// A User who is purchasing from the pet store
/// </summary>
public sealed class User: IEquatable<User>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private static TValue DynamicValueOf<TValue>(dynamic parameters, string name)
private static IDictionary<Type, Func<Parameter, object>> CreateParsers()
{
var parsers = ImmutableDictionary.CreateBuilder<Type, Func<Parameter, object>>();
parsers.Put(typeof(string), value => value);
parsers.Put(typeof(string), value => value.Value);
parsers.Put(typeof(bool), SafeParse(bool.Parse));
parsers.Put(typeof(bool?), SafeParse(bool.Parse));
parsers.Put(typeof(byte), SafeParse(byte.Parse));
Expand Down Expand Up @@ -411,4 +411,4 @@ internal enum ParameterType
Path,
Header
}
}
}