Skip to content

Commit

Permalink
[C#] fix the location of FodyWeavers.xml (#3782)
Browse files Browse the repository at this point in the history
* fix fody weavers xml location

* update c# petstore sample
  • Loading branch information
wing328 authored Sep 13, 2016
1 parent 07eff71 commit 19047c2
Show file tree
Hide file tree
Showing 11 changed files with 320 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void processOpts() {
}

if(Boolean.TRUE.equals(generatePropertyChanged)) {
supportingFiles.add(new SupportingFile("FodyWeavers.xml", "", "FodyWeavers.xml"));
supportingFiles.add(new SupportingFile("FodyWeavers.xml", packageFolder, "FodyWeavers.xml"));
}

supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Ref: https://github.com/Fody/Fody -->
<Weavers>
<PropertyChanged/>
</Weavers>
</Weavers>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
{{#generatePropertyChanged}}using PropertyChanged;
using System.ComponentModel;{{/generatePropertyChanged}}
{{#generatePropertyChanged}}
using PropertyChanged;
using System.ComponentModel;
{{/generatePropertyChanged}}

{{#models}}
{{#model}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// <summary>
/// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
/// </summary>
[DataContract]{{#generatePropertyChanged}}
[ImplementPropertyChanged]{{/generatePropertyChanged}}
[DataContract]
{{#generatePropertyChanged}}
[ImplementPropertyChanged]
{{/generatePropertyChanged}}
public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>
{
{{#vars}}
Expand Down Expand Up @@ -181,5 +183,6 @@ this.{{name}} = {{name}};
{
propertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}{{/generatePropertyChanged}}
}
{{/generatePropertyChanged}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{#generatePropertyChanged}}<package id="Fody" version="1.29.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />{{/generatePropertyChanged}}
{{#generatePropertyChanged}}
<package id="Fody" version="1.29.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{/generatePropertyChanged}}
</packages>
19 changes: 6 additions & 13 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", "{497E0E11-BFD7-4CB3-BA32-A19285FBB551}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1F7D41FE-F060-43E8-8866-F14DA42E2A22}"
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,17 +12,10 @@ Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
<<<<<<< HEAD
{497E0E11-BFD7-4CB3-BA32-A19285FBB551}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{497E0E11-BFD7-4CB3-BA32-A19285FBB551}.Debug|Any CPU.Build.0 = Debug|Any CPU
{497E0E11-BFD7-4CB3-BA32-A19285FBB551}.Release|Any CPU.ActiveCfg = Release|Any CPU
{497E0E11-BFD7-4CB3-BA32-A19285FBB551}.Release|Any CPU.Build.0 = Release|Any CPU
=======
{852B5B14-5D2E-4A76-AA16-DCA2E8B4CCCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{852B5B14-5D2E-4A76-AA16-DCA2E8B4CCCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{852B5B14-5D2E-4A76-AA16-DCA2E8B4CCCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{852B5B14-5D2E-4A76-AA16-DCA2E8B4CCCB}.Release|Any CPU.Build.0 = Release|Any CPU
>>>>>>> 3d717bd87491572a1fdca4b146f0666a8f67bccb
{1F7D41FE-F060-43E8-8866-F14DA42E2A22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F7D41FE-F060-43E8-8866-F14DA42E2A22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F7D41FE-F060-43E8-8866-F14DA42E2A22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F7D41FE-F060-43E8-8866-F14DA42E2A22}.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 All @@ -31,4 +24,4 @@ EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
EndGlobal
7 changes: 3 additions & 4 deletions samples/client/petstore/csharp/SwaggerClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,19 @@ Class | Method | HTTP request | Description

## Documentation for Authorization

<a name="api_key"></a>
### api_key

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

<a name="http_basic_test"></a>
### http_basic_test

- **Type**: HTTP basic authentication

<a name="petstore_auth"></a>
### petstore_auth

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

### http_basic_test

- **Type**: HTTP basic authentication

10 changes: 10 additions & 0 deletions samples/client/petstore/csharp/SwaggerClient/docs/EnumArrays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IO.Swagger.Model.EnumArrays
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustSymbol** | **string** | | [optional]
**ArrayEnum** | **List&lt;string&gt;** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


using NUnit.Framework;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using IO.Swagger.Api;
using IO.Swagger.Model;
using IO.Swagger.Client;
using System.Reflection;

namespace IO.Swagger.Test
{
/// <summary>
/// Class for testing EnumArrays
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class EnumArraysTests
{
// TODO uncomment below to declare an instance variable for EnumArrays
//private EnumArrays instance;

/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of EnumArrays
//instance = new EnumArrays();
}

/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{

}

/// <summary>
/// Test an instance of EnumArrays
/// </summary>
[Test]
public void EnumArraysInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" EnumArrays
//Assert.IsInstanceOfType<EnumArrays> (instance, "variable 'instance' is a EnumArrays");
}

/// <summary>
/// Test the property 'JustSymbol'
/// </summary>
[Test]
public void JustSymbolTest()
{
// TODO unit test for the property 'JustSymbol'
}
/// <summary>
/// Test the property 'ArrayEnum'
/// </summary>
[Test]
public void ArrayEnumTest()
{
// TODO unit test for the property 'ArrayEnum'
}

}

}
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>{497E0E11-BFD7-4CB3-BA32-A19285FBB551}</ProjectGuid>
<ProjectGuid>{1F7D41FE-F060-43E8-8866-F14DA42E2A22}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IO.Swagger</RootNamespace>
Expand Down Expand Up @@ -70,13 +70,14 @@ limitations under the License.
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
</Reference>

</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"/>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" /></Project>

Loading

0 comments on commit 19047c2

Please sign in to comment.