[csharp] clean boolean additional properties 6784 (#6899)

* [csharp] Convert "false" properties to booleans

It appears as though "false" strings in additionalProperties are no
longer treated as false booleans. This may be an issue elsewhere, but a
simple fix is to always explicitly set the boolean value in a generator
class back to the additionalProperties map to convert boolean Strings to
boolean Objects.

* [nancyfx] Clean up async default option handling

* [nancyfx] Include asyncServer=false in sample script

* [csharp] Regenerate samples

* [csharp] Resolve .net 4 generation issues

Some functionality is missing from .NET 4.0, such as IReadonlyDictionary
and Type.GetTypeInfo().

This commit resolves compilation of generated .NET 4.0 code, requiring
no conditional versioning of Newtonsoft.Json.

* [csharp] Regenerate .net 4.0 sample

* [csharp] Resolve .NET 4.0 sample compile

Sample build.sh wasn't accounting for targeting different FCL correctly.
That is, when passing "net40" to the -sdk option, it would use the
default -sdk:4 and -langversion:6. These don't necessarily match with
what is installed on a machine with only .NET 4.0 (which is our targeted
use case here).

To resolve, we need to define another version-specific value for passing
to the mcs -sdk option (see man mcs for details).

This option currently isn't overridable in the client codegen class.
Also, langversion is set specifically to the version of C# available to
the targeted SDK version. If there is need, we may extend this to
something like:

langversion=${MCS_LANG_VERSION:-6}

To allow users to run as:

   env MCS_LANG_VERSION=5 sh build.sh

I haven't done this because I doubt there's much of a use case via this
script. I'm assuming most consumers will build via IDE or MSBuild.

* [csharp] Revert bin/csharp-petstore.sh to 3.5

* [csharp] Regenerate .NET 3.5 sample

* [csharp] Resolve nuget issue with existing files

* [csharp] Update -all.sh, regenerate samples
This commit is contained in:
Jim Schubert
2017-11-15 09:36:37 -05:00
committed by William Cheng
parent 970de01bdf
commit 2c9f98ce38
69 changed files with 3455 additions and 270 deletions

View File

@@ -343,10 +343,10 @@ namespace Example
Configuration.Default.Password = "YOUR_PASSWORD";
var apiInstance = new FakeApi();
var number = 3.4; // decimal? | None
var number = 8.14; // decimal? | None
var _double = 1.2; // double? | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
var _byte = _byte_example; // byte[] | None
var _byte = B; // byte[] | None
var integer = 56; // int? | None (optional)
var int32 = 56; // int? | None (optional)
var int64 = 789; // long? | None (optional)
@@ -486,8 +486,6 @@ No authorization required
test inline additionalProperties
### Example
```csharp
using System;
@@ -546,8 +544,6 @@ No authorization required
test json serialization of form data
### Example
```csharp
using System;

View File

@@ -20,8 +20,6 @@ Method | HTTP request | Description
Add a new pet to the store
### Example
```csharp
using System;
@@ -83,8 +81,6 @@ void (empty response body)
Deletes a pet
### Example
```csharp
using System;
@@ -342,8 +338,6 @@ Name | Type | Description | Notes
Update an existing pet
### Example
```csharp
using System;
@@ -405,8 +399,6 @@ void (empty response body)
Updates a pet in the store with form data
### Example
```csharp
using System;
@@ -472,8 +464,6 @@ void (empty response body)
uploads an image
### Example
```csharp
using System;

View File

@@ -199,8 +199,6 @@ No authorization required
Place an order for a pet
### Example
```csharp
using System;

View File

@@ -80,8 +80,6 @@ No authorization required
Creates list of users with given input array
### Example
```csharp
using System;
@@ -140,8 +138,6 @@ No authorization required
Creates list of users with given input array
### Example
```csharp
using System;
@@ -260,8 +256,6 @@ No authorization required
Get user by user name
### Example
```csharp
using System;
@@ -321,8 +315,6 @@ No authorization required
Logs user into the system
### Example
```csharp
using System;
@@ -384,8 +376,6 @@ No authorization required
Logs out current logged in user session
### Example
```csharp
using System;