forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -70,9 +70,9 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||
-------------------------- | ------------ | -------------------------- | -----
|
||||
2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes
|
||||
2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes
|
||||
2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2)
|
||||
2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1)
|
||||
2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)
|
||||
[2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2)
|
||||
[2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1)
|
||||
[2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)
|
||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
|
||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||
|
||||
|
||||
3
bin/jaxrs-resteasy-eap-joda-petstore-server.json
Normal file
3
bin/jaxrs-resteasy-eap-joda-petstore-server.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"dateLibrary": "joda"
|
||||
}
|
||||
35
bin/jaxrs-resteasy-eap-joda-petstore-server.sh
Normal file
35
bin/jaxrs-resteasy-eap-joda-petstore-server.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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 --artifact-id swagger-jaxrs-resteasy-eap-joda-server -t modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-joda -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-joda-petstore-server.json"
|
||||
|
||||
echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-joda/src/main"
|
||||
rm -rf samples/server/petstore/jaxrs-resteasy/eap-joda/src/main
|
||||
find samples/server/petstore/jaxrs-resteasy/eap-joda -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
35
bin/jaxrs-resteasy-eap-petstore-server.sh
Normal file
35
bin/jaxrs-resteasy-eap-petstore-server.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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/JavaJaxRS/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap -DhideGenerationTimestamp=true"
|
||||
|
||||
echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap/src/main"
|
||||
rm -rf samples/server/petstore/jaxrs-resteasy/eap/src/main
|
||||
find samples/server/petstore/jaxrs-resteasy/eap -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -26,6 +26,6 @@ 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 -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l csharp -o samples/client/petstore-security-test/csharp/SwaggerClient"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l csharp -o samples/client/petstore-security-test/csharp/SwaggerClient --additional-properties packageGuid={8CE139DF-64BC-4591-85F8-8506C2B67514}"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -26,6 +26,6 @@ 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/typescript-fetch -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-fetch -o samples/client/petstore-security-test/typescript-fetch"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/TypeScript-Fetch -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-fetch -o samples/client/petstore-security-test/typescript-fetch"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package io.swagger.api;
|
||||
package {{invokerPackage}};
|
||||
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.swagger.jaxrs.config.BeanConfig;
|
||||
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
import {{invokerPackage}}.impl.{{classname}}ServiceImpl;
|
||||
import {{package}}.impl.{{classname}}ServiceImpl;
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
<context-param>
|
||||
<param-name>resteasy.providers</param-name>
|
||||
<param-value>io.swagger.api.JacksonConfig</param-value>
|
||||
<param-value>{{invokerPackage}}.JacksonConfig</param-value>
|
||||
</context-param>
|
||||
</web-app>
|
||||
|
||||
26
pom.xml
26
pom.xml
@@ -542,6 +542,30 @@
|
||||
<module>samples/server/petstore/jaxrs-resteasy/joda</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-resteasy-eap-server</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/eap</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-resteasy-eap-server-joda</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/eap-joda</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-server</id>
|
||||
<activation>
|
||||
@@ -789,6 +813,8 @@
|
||||
<module>samples/server/petstore/jaxrs/jersey1</module>
|
||||
<module>samples/server/petstore/jaxrs/jersey2</module>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/default</module>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/eap</module>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/eap-joda</module>
|
||||
<module>samples/server/petstore/jaxrs-resteasy/joda</module>
|
||||
<module>samples/server/petstore/scalatra</module>
|
||||
<module>samples/server/petstore/spring-mvc</module>
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
language: csharp
|
||||
mono:
|
||||
- latest
|
||||
|
||||
@@ -6,18 +6,19 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
||||
|
||||
- API version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
- SDK version: 1.0.0
|
||||
- Build date: 2016-07-13T18:16:08.689+08:00
|
||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
|
||||
|
||||
<a name="frameworks-supported"></a>
|
||||
## Frameworks supported
|
||||
- .NET 4.0 or later
|
||||
- Windows Phone 7.1 (Mango)
|
||||
|
||||
<a name="dependencies"></a>
|
||||
## Dependencies
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
|
||||
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
|
||||
|
||||
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
||||
The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
||||
```
|
||||
Install-Package RestSharp
|
||||
Install-Package Newtonsoft.Json
|
||||
@@ -25,6 +26,7 @@ Install-Package Newtonsoft.Json
|
||||
|
||||
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
|
||||
|
||||
<a name="installation"></a>
|
||||
## Installation
|
||||
Run the following command to generate the DLL
|
||||
- [Mac/Linux] `/bin/sh build.sh`
|
||||
@@ -34,9 +36,22 @@ Then include the DLL (under the `bin` folder) in the C# project, and use the nam
|
||||
```csharp
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using Model;
|
||||
using IO.Swagger.Model;
|
||||
```
|
||||
<a name="packaging"></a>
|
||||
## Packaging
|
||||
|
||||
A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.
|
||||
|
||||
This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:
|
||||
|
||||
```
|
||||
nuget pack -Build -OutputDirectory out IO.Swagger.csproj
|
||||
```
|
||||
|
||||
Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.
|
||||
|
||||
<a name="getting-started"></a>
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
@@ -44,7 +59,7 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using Model;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
@@ -86,20 +101,23 @@ Class | Method | HTTP request | Description
|
||||
- [Model.ModelReturn](docs/ModelReturn.md)
|
||||
|
||||
|
||||
<a name="documentation-for-authorization"></a>
|
||||
## Documentation for Authorization
|
||||
|
||||
<a name="api_key"></a>
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
<a name="petstore_auth"></a>
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account */ ' " =end -- \r\n \n \r
|
||||
- read:pets: read your pets */ ' " =end -- \r\n \n \r
|
||||
- write:pets: modify pets in your account *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
- read:pets: read your pets *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
:: 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.
|
||||
|
||||
@echo off
|
||||
|
||||
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
|
||||
|
||||
|
||||
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
|
||||
.\nuget.exe install src\IO.Swagger\packages.config -o packages
|
||||
|
||||
@@ -24,5 +12,5 @@ if not exist ".\bin" mkdir bin
|
||||
|
||||
copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml
|
||||
|
||||
@@ -2,17 +2,6 @@
|
||||
#
|
||||
# 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.
|
||||
|
||||
frameworkVersion=net45
|
||||
netfx=${frameworkVersion#net}
|
||||
@@ -32,6 +21,7 @@ cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
|
||||
echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll"
|
||||
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
|
||||
bin/RestSharp.dll,\
|
||||
System.ComponentModel.DataAnnotations.dll,\
|
||||
System.Runtime.Serialization.dll \
|
||||
-target:library \
|
||||
-out:bin/IO.Swagger.dll \
|
||||
|
||||
@@ -2,17 +2,6 @@
|
||||
#
|
||||
# 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.
|
||||
|
||||
wget -nc https://nuget.org/nuget.exe
|
||||
mozroots --import --sync
|
||||
@@ -26,8 +15,8 @@ mozroots --import --sync
|
||||
mono nuget.exe install src/IO.Swagger.Test/packages.config -o packages
|
||||
|
||||
echo "[INFO] Install NUnit runners via NuGet"
|
||||
mono nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory packages
|
||||
mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
|
||||
|
||||
echo "[INFO] Build the solution and run the unit test"
|
||||
xbuild IO.Swagger.sln && \
|
||||
mono ./packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll
|
||||
mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll
|
||||
|
||||
@@ -6,19 +6,6 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
|
||||
|
||||
OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
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.
|
||||
-->
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
@@ -54,6 +41,7 @@ limitations under the License.
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
@@ -71,10 +59,10 @@ limitations under the License.
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="3.2.1" targetFramework="net45" />
|
||||
<package id="NUnit" version="2.6.4" targetFramework="net45" />
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
@@ -235,9 +223,6 @@ namespace IO.Swagger.Api
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter
|
||||
|
||||
|
||||
@@ -305,9 +290,6 @@ namespace IO.Swagger.Api
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter
|
||||
|
||||
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
@@ -179,7 +167,28 @@ namespace IO.Swagger.Client
|
||||
/// <returns></returns>
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
_defaultHeaderMap.Add(key, value);
|
||||
_defaultHeaderMap[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Api Key Header.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
/// <returns></returns>
|
||||
public void AddApiKey(string key, string value)
|
||||
{
|
||||
ApiKey[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the API key prefix.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
public void AddApiKeyPrefix(string key, string value)
|
||||
{
|
||||
ApiKeyPrefix[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -234,7 +243,7 @@ namespace IO.Swagger.Client
|
||||
return apiKeyValue;
|
||||
}
|
||||
|
||||
private string _tempFolderPath = Path.GetTempPath();
|
||||
private string _tempFolderPath;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the temporary folder path to store the files downloaded from the server.
|
||||
@@ -242,7 +251,15 @@ namespace IO.Swagger.Client
|
||||
/// <value>Folder path.</value>
|
||||
public String TempFolderPath
|
||||
{
|
||||
get { return _tempFolderPath; }
|
||||
get
|
||||
{
|
||||
// default to Path.GetTempPath() if _tempFolderPath is not set
|
||||
if (String.IsNullOrEmpty(_tempFolderPath))
|
||||
{
|
||||
_tempFolderPath = Path.GetTempPath();
|
||||
}
|
||||
return _tempFolderPath;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -6,29 +6,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
|
||||
|
||||
OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
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.
|
||||
-->
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8CE139DF-64BC-4591-85F8-8506C2B67514}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Swagger Library</RootNamespace>
|
||||
<AssemblyName>Swagger Library</AssemblyName>
|
||||
<RootNamespace>IO.Swagger</RootNamespace>
|
||||
<AssemblyName>IO.Swagger</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
@@ -54,6 +42,7 @@ limitations under the License.
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
@@ -70,13 +59,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>
|
||||
|
||||
</ItemGroup>
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" /></Project>
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<!-- The identifier that must be unique within the hosting gallery -->
|
||||
<id>$id$</id>
|
||||
<title>Swagger Library</title>
|
||||
|
||||
<!-- The package version number that is used when resolving dependencies -->
|
||||
<version>$version$</version>
|
||||
|
||||
<!-- Authors contain text that appears directly on the gallery -->
|
||||
<authors>$author$</authors>
|
||||
|
||||
<!-- Owners are typically nuget.org identities that allow gallery
|
||||
users to earily find other packages by the same owners. -->
|
||||
<owners>$author$</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<developmentDependency>false</developmentDependency>
|
||||
|
||||
<!-- The description can be used in package manager UI. Note that the
|
||||
nuget.org gallery uses information you add in the portal. -->
|
||||
<description>A library generated from a Swagger doc</description>
|
||||
<copyright>http://swagger.io/terms/ *_/ ' \" =end - - \\r\\n \\n \\r</copyright>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html *_/ ' \" =end - - \\r\\n \\n \\r</licenseUrl>
|
||||
|
||||
<!-- Dependencies are automatically installed when the package is installed -->
|
||||
<dependencies>
|
||||
|
||||
<dependency id="NewtonSoft.Json" version="8.0.3" />
|
||||
<dependency id="RestSharp" version="105.1.0" />
|
||||
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
||||
<!-- A readme.txt will be displayed when the package is installed -->
|
||||
<file src="..\..\README.md" target="" />
|
||||
<file src="..\..\docs\**\*.*" target="docs" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -6,30 +6,20 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
* 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 System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
@@ -37,13 +27,13 @@ namespace IO.Swagger.Model
|
||||
/// Model for testing reserved words *_/ ' \" =end - - \\r\\n \\n \\r
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ModelReturn : IEquatable<ModelReturn>
|
||||
public partial class ModelReturn : IEquatable<ModelReturn>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ModelReturn" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_Return">property description *_/ ' \" =end - - \\r\\n \\n \\r.</param>
|
||||
public ModelReturn(int? _Return = null)
|
||||
public ModelReturn(int? _Return = default(int?))
|
||||
{
|
||||
this._Return = _Return;
|
||||
}
|
||||
@@ -122,6 +112,16 @@ namespace IO.Swagger.Model
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
# Go API client for swagger
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
|
||||
## Overview
|
||||
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
||||
|
||||
- API version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-07-12T18:49:24.937+08:00
|
||||
- Build package: class io.swagger.codegen.languages.GoClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.GoClientCodegen
|
||||
|
||||
## Installation
|
||||
Put the package under your project folder and add the following in import:
|
||||
@@ -18,11 +17,11 @@ Put the package under your project folder and add the following in import:
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r*
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**TestCodeInjectEndRnNR**](docs/FakeApi.md#testcodeinjectendrnnr) | **Put** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
||||
*FakeApi* | [**TestCodeInjectEndRnNR**](docs/FakeApi.md#testcodeinjectendrnnr) | **Put** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
@@ -36,7 +35,7 @@ Class | Method | HTTP request | Description
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end \r\n \n \r
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
## petstore_auth
|
||||
@@ -45,11 +44,11 @@ Class | Method | HTTP request | Description
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- **write:pets**: modify pets in your account */ ' " =end \r\n \n \r
|
||||
- **read:pets**: read your pets */ ' " =end \r\n \n \r
|
||||
- **write:pets**: modify pets in your account *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
- **read:pets**: read your pets *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
/*
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package swagger
|
||||
@@ -29,10 +17,12 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"net/url"
|
||||
"io/ioutil"
|
||||
"github.com/go-resty/resty"
|
||||
)
|
||||
|
||||
type APIClient struct {
|
||||
config *Configuration
|
||||
}
|
||||
|
||||
func (c *APIClient) SelectHeaderContentType(contentTypes []string) string {
|
||||
@@ -57,9 +47,9 @@ func (c *APIClient) SelectHeaderAccept(accepts []string) string {
|
||||
return strings.Join(accepts, ",")
|
||||
}
|
||||
|
||||
func contains(source []string, containvalue string) bool {
|
||||
for _, a := range source {
|
||||
if strings.ToLower(a) == strings.ToLower(containvalue) {
|
||||
func contains(haystack []string, needle string) bool {
|
||||
for _, a := range haystack {
|
||||
if strings.ToLower(a) == strings.ToLower(needle) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -74,11 +64,8 @@ func (c *APIClient) CallAPI(path string, method string,
|
||||
fileName string,
|
||||
fileBytes []byte) (*resty.Response, error) {
|
||||
|
||||
//set debug flag
|
||||
configuration := NewConfiguration()
|
||||
resty.SetDebug(configuration.GetDebug())
|
||||
|
||||
request := prepareRequest(postBody, headerParams, queryParams, formParams, fileName, fileBytes)
|
||||
rClient := c.prepareClient()
|
||||
request := c.prepareRequest(rClient, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
|
||||
|
||||
switch strings.ToUpper(method) {
|
||||
case "GET":
|
||||
@@ -102,32 +89,58 @@ func (c *APIClient) CallAPI(path string, method string,
|
||||
}
|
||||
|
||||
func (c *APIClient) ParameterToString(obj interface{}, collectionFormat string) string {
|
||||
if reflect.TypeOf(obj).String() == "[]string" {
|
||||
delimiter := ""
|
||||
switch collectionFormat {
|
||||
case "pipes":
|
||||
return strings.Join(obj.([]string), "|")
|
||||
delimiter = "|"
|
||||
case "ssv":
|
||||
return strings.Join(obj.([]string), " ")
|
||||
delimiter = " "
|
||||
case "tsv":
|
||||
return strings.Join(obj.([]string), "\t")
|
||||
delimiter = "\t"
|
||||
case "csv":
|
||||
return strings.Join(obj.([]string), ",")
|
||||
}
|
||||
delimiter = ","
|
||||
}
|
||||
|
||||
return obj.(string)
|
||||
if reflect.TypeOf(obj).Kind() == reflect.Slice {
|
||||
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
|
||||
}
|
||||
|
||||
func prepareRequest(postBody interface{},
|
||||
return fmt.Sprintf("%v", obj)
|
||||
}
|
||||
|
||||
func (c *APIClient) prepareClient() *resty.Client {
|
||||
|
||||
rClient := resty.New()
|
||||
|
||||
rClient.SetDebug(c.config.Debug)
|
||||
if c.config.Transport != nil {
|
||||
rClient.SetTransport(c.config.Transport)
|
||||
}
|
||||
|
||||
if c.config.Timeout != nil {
|
||||
rClient.SetTimeout(*c.config.Timeout)
|
||||
}
|
||||
rClient.SetLogger(ioutil.Discard)
|
||||
return rClient
|
||||
}
|
||||
|
||||
func (c *APIClient) prepareRequest(
|
||||
rClient *resty.Client,
|
||||
postBody interface{},
|
||||
headerParams map[string]string,
|
||||
queryParams url.Values,
|
||||
formParams map[string]string,
|
||||
fileName string,
|
||||
fileBytes []byte) *resty.Request {
|
||||
|
||||
request := resty.R()
|
||||
|
||||
request := rClient.R()
|
||||
request.SetBody(postBody)
|
||||
|
||||
if c.config.UserAgent != "" {
|
||||
request.SetHeader("User-Agent", c.config.UserAgent)
|
||||
}
|
||||
|
||||
// add header parameter, if any
|
||||
if len(headerParams) > 0 {
|
||||
request.SetHeaders(headerParams)
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
/*
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package swagger
|
||||
@@ -27,8 +15,20 @@ import (
|
||||
)
|
||||
|
||||
type APIResponse struct {
|
||||
*http.Response
|
||||
*http.Response `json:"-"`
|
||||
Message string `json:"message,omitempty"`
|
||||
// Operation is the name of the swagger operation.
|
||||
Operation string `json:"operation,omitempty"`
|
||||
// RequestURL is the request URL. This value is always available, even if the
|
||||
// embedded *http.Response is nil.
|
||||
RequestURL string `json:"url,omitempty"`
|
||||
// Method is the HTTP method used for the request. This value is always
|
||||
// available, even if the embedded *http.Response is nil.
|
||||
Method string `json:"method,omitempty"`
|
||||
// Payload holds the contents of the response body (which may be nil or empty).
|
||||
// This is provided here as the raw response.Body() reader will have already
|
||||
// been drained.
|
||||
Payload []byte `json:"-"`
|
||||
}
|
||||
|
||||
func NewAPIResponse(r *http.Response) *APIResponse {
|
||||
|
||||
@@ -1,63 +1,57 @@
|
||||
/*
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
type Configuration struct {
|
||||
UserName string `json:"userName,omitempty"`
|
||||
Username string `json:"userName,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
APIKeyPrefix map[string]string `json:"APIKeyPrefix,omitempty"`
|
||||
APIKey map[string]string `json:"APIKey,omitempty"`
|
||||
debug bool `json:"debug,omitempty"`
|
||||
Debug bool `json:"debug,omitempty"`
|
||||
DebugFile string `json:"debugFile,omitempty"`
|
||||
OAuthToken string `json:"oAuthToken,omitempty"`
|
||||
Timeout int `json:"timeout,omitempty"`
|
||||
BasePath string `json:"basePath,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
AccessToken string `json:"accessToken,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
UserAgent string `json:"userAgent,omitempty"`
|
||||
APIClient APIClient `json:"APIClient,omitempty"`
|
||||
APIClient *APIClient
|
||||
Transport *http.Transport
|
||||
Timeout *time.Duration `json:"timeout,omitempty"`
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
return &Configuration{
|
||||
BasePath: "https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r",
|
||||
UserName: "",
|
||||
debug: false,
|
||||
cfg := &Configuration{
|
||||
BasePath: "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r",
|
||||
DefaultHeader: make(map[string]string),
|
||||
APIKey: make(map[string]string),
|
||||
APIKeyPrefix: make(map[string]string),
|
||||
UserAgent: "Swagger-Codegen/1.0.0/go",
|
||||
APIClient: &APIClient{},
|
||||
}
|
||||
|
||||
cfg.APIClient.config = cfg
|
||||
return cfg
|
||||
}
|
||||
|
||||
func (c *Configuration) GetBasicAuthEncodedString() string {
|
||||
return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password))
|
||||
return base64.StdEncoding.EncodeToString([]byte(c.Username + ":" + c.Password))
|
||||
}
|
||||
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
@@ -71,11 +65,3 @@ func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string {
|
||||
|
||||
return c.APIKey[APIKeyIdentifier]
|
||||
}
|
||||
|
||||
func (c *Configuration) SetDebug(enable bool) {
|
||||
c.debug = enable
|
||||
}
|
||||
|
||||
func (c *Configuration) GetDebug() bool {
|
||||
return c.debug
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# \FakeApi
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r*
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**TestCodeInjectEndRnNR**](FakeApi.md#TestCodeInjectEndRnNR) | **Put** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
||||
[**TestCodeInjectEndRnNR**](FakeApi.md#TestCodeInjectEndRnNR) | **Put** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
# **TestCodeInjectEndRnNR**
|
||||
> TestCodeInjectEndRnNR($testCodeInjectEndRnNR)
|
||||
|
||||
To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
||||
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**testCodeInjectEndRnNR** | **string**| To test code injection *_/ ' \" =end \\r\\n \\n \\r | [optional]
|
||||
**testCodeInjectEndRnNR** | **string**| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -29,8 +29,8 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, *_/ ' =end
|
||||
- **Accept**: application/json, *_/ ' =end
|
||||
- **Content-Type**: application/json, *_/ ' =end --
|
||||
- **Accept**: application/json, *_/ ' =end --
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Return_** | **int32** | property description *_/ ' \" =end \\r\\n \\n \\r | [optional] [default to null]
|
||||
**Return_** | **int32** | property description *_/ ' \" =end -- \\r\\n \\n \\r | [optional] [default to null]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -1,42 +1,28 @@
|
||||
/*
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"fmt"
|
||||
"errors"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type FakeApi struct {
|
||||
Configuration Configuration
|
||||
Configuration *Configuration
|
||||
}
|
||||
|
||||
func NewFakeApi() *FakeApi {
|
||||
configuration := NewConfiguration()
|
||||
return &FakeApi{
|
||||
Configuration: *configuration,
|
||||
Configuration: configuration,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,63 +31,66 @@ func NewFakeApiWithBasePath(basePath string) *FakeApi {
|
||||
configuration.BasePath = basePath
|
||||
|
||||
return &FakeApi{
|
||||
Configuration: *configuration,
|
||||
Configuration: configuration,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
||||
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @return void
|
||||
*/
|
||||
func (a FakeApi) TestCodeInjectEndRnNR(testCodeInjectEndRnNR string) (*APIResponse, error) {
|
||||
|
||||
var httpMethod = "Put"
|
||||
var localVarHttpMethod = strings.ToUpper("Put")
|
||||
// create path and map variables
|
||||
path := a.Configuration.BasePath + "/fake"
|
||||
|
||||
|
||||
headerParams := make(map[string]string)
|
||||
queryParams := url.Values{}
|
||||
formParams := make(map[string]string)
|
||||
var postBody interface{}
|
||||
var fileName string
|
||||
var fileBytes []byte
|
||||
localVarPath := a.Configuration.BasePath + "/fake"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := make(map[string]string)
|
||||
var localVarPostBody interface{}
|
||||
var localVarFileName string
|
||||
var localVarFileBytes []byte
|
||||
// add default headers if any
|
||||
for key := range a.Configuration.DefaultHeader {
|
||||
headerParams[key] = a.Configuration.DefaultHeader[key]
|
||||
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{ "application/json", "*_/ ' =end ", }
|
||||
localVarHttpContentTypes := []string{ "application/json", "*_/ ' =end -- ", }
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
|
||||
if localVarHttpContentType != "" {
|
||||
headerParams["Content-Type"] = localVarHttpContentType
|
||||
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||
}
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{
|
||||
"application/json",
|
||||
"*_/ ' =end ",
|
||||
"*_/ ' =end -- ",
|
||||
}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
if localVarHttpHeaderAccept != "" {
|
||||
headerParams["Accept"] = localVarHttpHeaderAccept
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
localVarFormParams["testCodeInjectEndRnNR"] = a.Configuration.APIClient.ParameterToString(testCodeInjectEndRnNR, "")
|
||||
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
|
||||
var localVarURL, _ = url.Parse(localVarPath)
|
||||
localVarURL.RawQuery = localVarQueryParams.Encode()
|
||||
var localVarAPIResponse = &APIResponse{Operation: "TestCodeInjectEndRnNR", Method: localVarHttpMethod, RequestURL: localVarURL.String()}
|
||||
if localVarHttpResponse != nil {
|
||||
localVarAPIResponse.Response = localVarHttpResponse.RawResponse
|
||||
localVarAPIResponse.Payload = localVarHttpResponse.Body()
|
||||
}
|
||||
|
||||
formParams["testCodeInjectEndRnNR"] = testCodeInjectEndRnNR
|
||||
|
||||
httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)
|
||||
if err != nil {
|
||||
return NewAPIResponse(httpResponse.RawResponse), err
|
||||
}
|
||||
|
||||
return NewAPIResponse(httpResponse.RawResponse), err
|
||||
return localVarAPIResponse, err
|
||||
}
|
||||
return localVarAPIResponse, err
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
/*
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
// Model for testing reserved words *_/ ' \" =end \\r\\n \\n \\r
|
||||
// Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
type ModelReturn struct {
|
||||
|
||||
// property description *_/ ' \" =end \\r\\n \\n \\r
|
||||
// property description *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
Return_ int32 `json:"return,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
* Do not edit this file by hand or your changes will be lost next time it is
|
||||
* generated.
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
|
||||
* Version: 1.0.0 ' \" =end
|
||||
* Generated at: 2016-06-29T22:04:03.401+08:00
|
||||
* Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
* Version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
|
||||
*/
|
||||
/**
|
||||
* @license Apache 2.0 ' \" =end
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.html ' \" =end
|
||||
* @license Apache 2.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.html *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
|
||||
goog.provide('API.Client.FakeApi');
|
||||
@@ -27,7 +26,7 @@ API.Client.FakeApi = function($http, $httpParamSerializer, $injector) {
|
||||
/** @private {!string} */
|
||||
this.basePath_ = $injector.has('FakeApiBasePath') ?
|
||||
/** @type {!string} */ ($injector.get('FakeApiBasePath')) :
|
||||
'https://petstore.swagger.io ' \" =end/v2 ' \" =end';
|
||||
'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||
|
||||
/** @private {!Object<string, string>} */
|
||||
this.defaultHeaders_ = $injector.has('FakeApiDefaultHeaders') ?
|
||||
@@ -44,13 +43,13 @@ API.Client.FakeApi = function($http, $httpParamSerializer, $injector) {
|
||||
API.Client.FakeApi.$inject = ['$http', '$httpParamSerializer', '$injector'];
|
||||
|
||||
/**
|
||||
* To test code injection ' \" =end
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param {!string=} opt_testCodeInjectEnd To test code injection ' \" =end
|
||||
* @param {!string=} opt_testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
|
||||
* @return {!angular.$q.Promise}
|
||||
*/
|
||||
API.Client.FakeApi.prototype.testCodeInjectEnd = function(opt_testCodeInjectEnd, opt_extraHttpRequestParams) {
|
||||
API.Client.FakeApi.prototype.testCodeInjectEndRnNR = function(opt_testCodeInjectEndRnNR, opt_extraHttpRequestParams) {
|
||||
/** @const {string} */
|
||||
var path = this.basePath_ + '/fake';
|
||||
|
||||
@@ -64,7 +63,7 @@ API.Client.FakeApi.prototype.testCodeInjectEnd = function(opt_testCodeInjectEnd,
|
||||
|
||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
formParams['test code inject */ ' " =end'] = opt_testCodeInjectEnd;
|
||||
formParams['test code inject */ ' " =end -- \r\n \n \r'] = opt_testCodeInjectEndRnNR;
|
||||
|
||||
/** @type {!Object} */
|
||||
var httpRequestParams = {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
goog.provide('API.Client.Return');
|
||||
|
||||
/**
|
||||
* Model for testing reserved words ' \" =end
|
||||
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @record
|
||||
*/
|
||||
API.Client.ModelReturn = function() {}
|
||||
|
||||
/**
|
||||
* property description ' \" =end
|
||||
* property description *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @type {!number}
|
||||
* @export
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
||||
|
||||
- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
- Package version: 1.0.0 *_/ =end -- \r\n \n \r
|
||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"name": "swagger_petstore____end____rn_n_r",
|
||||
"version": "1.0.0 *_/ =end -- \r\n \n \r",
|
||||
"description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters_______end______",
|
||||
"license": "Apache-2.0",
|
||||
"license": "Unlicense",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"test": "./node_modules/mocha/bin/mocha --recursive"
|
||||
},
|
||||
"dependencies": {
|
||||
"superagent": "1.7.1"
|
||||
"superagent": "3.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~2.3.4",
|
||||
|
||||
@@ -9,34 +9,23 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['superagent'], factory);
|
||||
define(['superagent', 'querystring'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('superagent'));
|
||||
module.exports = factory(require('superagent'), require('querystring'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.SwaggerPetstoreEndRnNR) {
|
||||
root.SwaggerPetstoreEndRnNR = {};
|
||||
}
|
||||
root.SwaggerPetstoreEndRnNR.ApiClient = factory(root.superagent);
|
||||
root.SwaggerPetstoreEndRnNR.ApiClient = factory(root.superagent, root.querystring);
|
||||
}
|
||||
}(this, function(superagent) {
|
||||
}(this, function(superagent, querystring) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
@@ -55,9 +44,9 @@
|
||||
/**
|
||||
* The base URL against which to resolve every API call's (relative) path.
|
||||
* @type {String}
|
||||
* @default https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @default https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
this.basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r'.replace(/\/+$/, '');
|
||||
this.basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r'.replace(/\/+$/, '');
|
||||
|
||||
/**
|
||||
* The authentication methods to be included for all API calls.
|
||||
@@ -80,6 +69,30 @@
|
||||
* @default 60000
|
||||
*/
|
||||
this.timeout = 60000;
|
||||
|
||||
/**
|
||||
* If set to false an additional timestamp parameter is added to all API GET calls to
|
||||
* prevent browser caching
|
||||
* @type {Boolean}
|
||||
* @default true
|
||||
*/
|
||||
this.cache = true;
|
||||
|
||||
/**
|
||||
* If set to true, the client will save the cookies from each server
|
||||
* response, and return them in the next request.
|
||||
* @default false
|
||||
*/
|
||||
this.enableCookies = false;
|
||||
|
||||
/*
|
||||
* Used to save and return cookies in a node.js (non-browser) setting,
|
||||
* if this.enableCookies is set to true.
|
||||
*/
|
||||
if (typeof window === 'undefined') {
|
||||
this.agent = new superagent.agent();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -316,13 +329,13 @@
|
||||
* @returns A value of the specified type.
|
||||
*/
|
||||
exports.prototype.deserialize = function deserialize(response, returnType) {
|
||||
if (response == null || returnType == null) {
|
||||
if (response == null || returnType == null || response.status == 204) {
|
||||
return null;
|
||||
}
|
||||
// Rely on SuperAgent for parsing response body.
|
||||
// See http://visionmedia.github.io/superagent/#parsing-response-bodies
|
||||
var data = response.body;
|
||||
if (data == null) {
|
||||
if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
|
||||
// SuperAgent does not always produce a body; use the unparsed response as a fallback
|
||||
data = response.text;
|
||||
}
|
||||
@@ -366,6 +379,9 @@
|
||||
this.applyAuthToRequest(request, authNames);
|
||||
|
||||
// set query parameters
|
||||
if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
|
||||
queryParams['_'] = new Date().getTime();
|
||||
}
|
||||
request.query(this.normalizeParams(queryParams));
|
||||
|
||||
// set header parameters
|
||||
@@ -385,7 +401,7 @@
|
||||
}
|
||||
|
||||
if (contentType === 'application/x-www-form-urlencoded') {
|
||||
request.send(this.normalizeParams(formParams));
|
||||
request.send(querystring.stringify(this.normalizeParams(formParams)));
|
||||
} else if (contentType == 'multipart/form-data') {
|
||||
var _formParams = this.normalizeParams(formParams);
|
||||
for (var key in _formParams) {
|
||||
@@ -407,12 +423,33 @@
|
||||
request.accept(accept);
|
||||
}
|
||||
|
||||
if (returnType === 'Blob') {
|
||||
request.responseType('blob');
|
||||
}
|
||||
|
||||
// Attach previously saved cookies, if enabled
|
||||
if (this.enableCookies){
|
||||
if (typeof window === 'undefined') {
|
||||
this.agent.attachCookies(request);
|
||||
}
|
||||
else {
|
||||
request.withCredentials();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
request.end(function(error, response) {
|
||||
if (callback) {
|
||||
var data = null;
|
||||
if (!error) {
|
||||
try {
|
||||
data = _this.deserialize(response, returnType);
|
||||
if (_this.enableCookies && typeof window === 'undefined'){
|
||||
_this.agent.saveCookies(response);
|
||||
}
|
||||
} catch (err) {
|
||||
error = err;
|
||||
}
|
||||
}
|
||||
callback(error, data, response);
|
||||
}
|
||||
@@ -437,9 +474,12 @@
|
||||
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
|
||||
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
|
||||
* all properties on <code>data<code> will be converted to this type.
|
||||
* @returns An instance of the specified type.
|
||||
* @returns An instance of the specified type or null or undefined if data is null or undefined.
|
||||
*/
|
||||
exports.convertToType = function(data, type) {
|
||||
if (data === null || data === undefined)
|
||||
return data
|
||||
|
||||
switch (type) {
|
||||
case 'Boolean':
|
||||
return Boolean(data);
|
||||
@@ -451,6 +491,8 @@
|
||||
return String(data);
|
||||
case 'Date':
|
||||
return this.parseDate(String(data));
|
||||
case 'Blob':
|
||||
return data;
|
||||
default:
|
||||
if (type === Object) {
|
||||
// generic object, return directly
|
||||
|
||||
@@ -9,17 +9,6 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
|
||||
@@ -9,17 +9,6 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
|
||||
@@ -9,17 +9,6 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
|
||||
@@ -59,9 +59,6 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513;
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/fake"];
|
||||
|
||||
// remove format in URL if needed
|
||||
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password.
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface SWGBasicAuthTokenProvider : NSObject
|
||||
|
||||
+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,19 @@
|
||||
#import "SWGBasicAuthTokenProvider.h"
|
||||
|
||||
@implementation SWGBasicAuthTokenProvider
|
||||
|
||||
+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password {
|
||||
|
||||
// return empty string if username and password are empty
|
||||
if (username.length == 0 && password.length == 0){
|
||||
return @"";
|
||||
}
|
||||
|
||||
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];
|
||||
NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding];
|
||||
basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]];
|
||||
|
||||
return basicAuthCredentials;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,166 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGConfiguration.h"
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
@class SWGApiClient;
|
||||
|
||||
@interface SWGDefaultConfiguration : NSObject <SWGConfiguration>
|
||||
|
||||
|
||||
/**
|
||||
* Default api logger
|
||||
*/
|
||||
@property (nonatomic, strong) SWGLogger * logger;
|
||||
|
||||
/**
|
||||
* Default base url
|
||||
*/
|
||||
@property (nonatomic) NSString *host;
|
||||
|
||||
/**
|
||||
* Api key values for Api Key type Authentication
|
||||
*
|
||||
* To add or remove api key, use `setApiKey:forApiKeyIdentifier:`.
|
||||
*/
|
||||
@property (readonly, nonatomic, strong) NSDictionary *apiKey;
|
||||
|
||||
/**
|
||||
* Api key prefix values to be prepend to the respective api key
|
||||
*
|
||||
* To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`.
|
||||
*/
|
||||
@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix;
|
||||
|
||||
/**
|
||||
* Username for HTTP Basic Authentication
|
||||
*/
|
||||
@property (nonatomic) NSString *username;
|
||||
|
||||
/**
|
||||
* Password for HTTP Basic Authentication
|
||||
*/
|
||||
@property (nonatomic) NSString *password;
|
||||
|
||||
/**
|
||||
* Access token for OAuth
|
||||
*/
|
||||
@property (nonatomic) NSString *accessToken;
|
||||
|
||||
/**
|
||||
* Temp folder for file download
|
||||
*/
|
||||
@property (nonatomic) NSString *tempFolderPath;
|
||||
|
||||
/**
|
||||
* Debug switch, default false
|
||||
*/
|
||||
@property (nonatomic) BOOL debug;
|
||||
|
||||
/**
|
||||
* Gets configuration singleton instance
|
||||
*/
|
||||
+ (instancetype) sharedConfig;
|
||||
|
||||
/**
|
||||
* SSL/TLS verification
|
||||
* Set this to NO to skip verifying SSL certificate when calling API from https server
|
||||
*/
|
||||
@property (nonatomic) BOOL verifySSL;
|
||||
|
||||
/**
|
||||
* SSL/TLS verification
|
||||
* Set this to customize the certificate file to verify the peer
|
||||
*/
|
||||
@property (nonatomic) NSString *sslCaCert;
|
||||
|
||||
/**
|
||||
* Sets API key
|
||||
*
|
||||
* To remove a apiKey for an identifier, just set the apiKey to nil.
|
||||
*
|
||||
* @param apiKey API key or token.
|
||||
* @param identifier API key identifier (authentication schema).
|
||||
*
|
||||
*/
|
||||
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier;
|
||||
|
||||
/**
|
||||
* Removes api key
|
||||
*
|
||||
* @param identifier API key identifier.
|
||||
*/
|
||||
- (void) removeApiKey:(NSString *)identifier;
|
||||
|
||||
/**
|
||||
* Sets the prefix for API key
|
||||
*
|
||||
* @param prefix API key prefix.
|
||||
* @param identifier API key identifier.
|
||||
*/
|
||||
- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier;
|
||||
|
||||
/**
|
||||
* Removes api key prefix
|
||||
*
|
||||
* @param identifier API key identifier.
|
||||
*/
|
||||
- (void) removeApiKeyPrefix:(NSString *)identifier;
|
||||
|
||||
/**
|
||||
* Gets API key (with prefix if set)
|
||||
*/
|
||||
- (NSString *) getApiKeyWithPrefix:(NSString *) key;
|
||||
|
||||
/**
|
||||
* Gets Basic Auth token
|
||||
*/
|
||||
- (NSString *) getBasicAuthToken;
|
||||
|
||||
/**
|
||||
* Gets OAuth access token
|
||||
*/
|
||||
- (NSString *) getAccessToken;
|
||||
|
||||
/**
|
||||
* Gets Authentication Settings
|
||||
*/
|
||||
- (NSDictionary *) authSettings;
|
||||
|
||||
/**
|
||||
* Default headers for all services
|
||||
*/
|
||||
@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders;
|
||||
|
||||
/**
|
||||
* Removes header from defaultHeaders
|
||||
*
|
||||
* @param key Header name.
|
||||
*/
|
||||
-(void) removeDefaultHeaderForKey:(NSString*)key;
|
||||
|
||||
/**
|
||||
* Sets the header for key
|
||||
*
|
||||
* @param value Value for header name
|
||||
* @param key Header name
|
||||
*/
|
||||
-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key;
|
||||
|
||||
/**
|
||||
* @param key Header key name.
|
||||
*/
|
||||
-(NSString*) defaultHeaderForKey:(NSString*)key;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,152 @@
|
||||
#import "SWGDefaultConfiguration.h"
|
||||
#import "SWGBasicAuthTokenProvider.h"
|
||||
#import "SWGLogger.h"
|
||||
|
||||
@interface SWGDefaultConfiguration ()
|
||||
|
||||
@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders;
|
||||
@property (nonatomic, strong) NSMutableDictionary *mutableApiKey;
|
||||
@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SWGDefaultConfiguration
|
||||
|
||||
#pragma mark - Singleton Methods
|
||||
|
||||
+ (instancetype) sharedConfig {
|
||||
static SWGDefaultConfiguration *shardConfig = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
shardConfig = [[self alloc] init];
|
||||
});
|
||||
return shardConfig;
|
||||
}
|
||||
|
||||
#pragma mark - Initialize Methods
|
||||
|
||||
- (instancetype) init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_host = @"https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r";
|
||||
_username = @"";
|
||||
_password = @"";
|
||||
_accessToken= @"";
|
||||
_verifySSL = YES;
|
||||
_mutableApiKey = [NSMutableDictionary dictionary];
|
||||
_mutableApiKeyPrefix = [NSMutableDictionary dictionary];
|
||||
_mutableDefaultHeaders = [NSMutableDictionary dictionary];
|
||||
|
||||
_logger = [SWGLogger sharedLogger];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Instance Methods
|
||||
|
||||
- (NSString *) getApiKeyWithPrefix:(NSString *)key {
|
||||
NSString *prefix = self.apiKeyPrefix[key];
|
||||
NSString *apiKey = self.apiKey[key];
|
||||
if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set
|
||||
return [NSString stringWithFormat:@"%@ %@", prefix, apiKey];
|
||||
}
|
||||
else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix
|
||||
return [NSString stringWithFormat:@"%@", self.apiKey[key]];
|
||||
}
|
||||
else { // return empty string if nothing is set
|
||||
return @"";
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *) getBasicAuthToken {
|
||||
|
||||
NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password];
|
||||
return basicAuthToken;
|
||||
}
|
||||
|
||||
- (NSString *) getAccessToken {
|
||||
if (self.accessToken.length == 0) { // token not set, return empty string
|
||||
return @"";
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"Bearer %@", self.accessToken];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Setter Methods
|
||||
|
||||
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier {
|
||||
[self.mutableApiKey setValue:apiKey forKey:identifier];
|
||||
}
|
||||
|
||||
- (void) removeApiKey:(NSString *)identifier {
|
||||
[self.mutableApiKey removeObjectForKey:identifier];
|
||||
}
|
||||
|
||||
- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier {
|
||||
[self.mutableApiKeyPrefix setValue:prefix forKey:identifier];
|
||||
}
|
||||
|
||||
- (void) removeApiKeyPrefix:(NSString *)identifier {
|
||||
[self.mutableApiKeyPrefix removeObjectForKey:identifier];
|
||||
}
|
||||
|
||||
#pragma mark - Getter Methods
|
||||
|
||||
- (NSDictionary *) apiKey {
|
||||
return [NSDictionary dictionaryWithDictionary:self.mutableApiKey];
|
||||
}
|
||||
|
||||
- (NSDictionary *) apiKeyPrefix {
|
||||
return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSDictionary *) authSettings {
|
||||
return @{
|
||||
@"api_key":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@"in": @"header",
|
||||
@"key": @"api_key */ ' " =end -- \r\n \n \r",
|
||||
@"value": [self getApiKeyWithPrefix:@"api_key */ ' " =end -- \r\n \n \r"]
|
||||
},
|
||||
@"petstore_auth":
|
||||
@{
|
||||
@"type": @"oauth",
|
||||
@"in": @"header",
|
||||
@"key": @"Authorization",
|
||||
@"value": [self getAccessToken]
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
-(BOOL)debug {
|
||||
return self.logger.isEnabled;
|
||||
}
|
||||
|
||||
-(void)setDebug:(BOOL)debug {
|
||||
self.logger.enabled = debug;
|
||||
}
|
||||
|
||||
- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key {
|
||||
if(!value) {
|
||||
[self.mutableDefaultHeaders removeObjectForKey:key];
|
||||
return;
|
||||
}
|
||||
self.mutableDefaultHeaders[key] = value;
|
||||
}
|
||||
|
||||
-(void) removeDefaultHeaderForKey:(NSString*)key {
|
||||
[self.mutableDefaultHeaders removeObjectForKey:key];
|
||||
}
|
||||
|
||||
- (NSString *)defaultHeaderForKey:(NSString *)key {
|
||||
return self.mutableDefaultHeaders[key];
|
||||
}
|
||||
|
||||
- (NSDictionary *)defaultHeaders {
|
||||
return [self.mutableDefaultHeaders copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,17 +1,16 @@
|
||||
# NAME
|
||||
|
||||
WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore */ ' \"
|
||||
WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
# VERSION
|
||||
|
||||
Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0 */ ' \"
|
||||
- API version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-06-28T16:32:36.006+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
## A note on Moose
|
||||
|
||||
@@ -248,38 +247,40 @@ use WWW::SwaggerClient::Object::ModelReturn;
|
||||
|
||||
# for displaying the API response data
|
||||
use Data::Dumper;
|
||||
use WWW::SwaggerClient::Configuration;
|
||||
use WWW::SwaggerClient::;
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::FakeApi->new();
|
||||
my $test code inject */ ' " =end = 'test code inject */ ' " =end_example'; # string | To test code injection */ ' \"
|
||||
my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
eval {
|
||||
$api_instance->test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end);
|
||||
$api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling FakeApi->test_code_inject____end: $@\n";
|
||||
warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n";
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
# DOCUMENTATION FOR API ENDPOINTS
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' " =end/v2 */ ' " =end*
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**test_code_inject____end**](docs/FakeApi.md#test_code_inject____end) | **PUT** /fake | To test code injection */ ' \"
|
||||
*FakeApi* | [**test_code_inject____end__rn_n_r**](docs/FakeApi.md#test_code_inject____end__rn_n_r) | **PUT** /fake | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
# DOCUMENTATION FOR MODELS
|
||||
- [WWW::SwaggerClient::Object::ModelReturn](docs/ModelReturn.md)
|
||||
|
||||
|
||||
# DOCUMENTATION FOR AUTHORIATION
|
||||
# DOCUMENTATION FOR AUTHORIZATION
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
## petstore_auth
|
||||
@@ -288,8 +289,6 @@ Class | Method | HTTP request | Description
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- **write:pets**: modify pets in your account */ ' " =end
|
||||
- **read:pets**: read your pets */ ' " =end
|
||||
|
||||
|
||||
- **write:pets**: modify pets in your account */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- **read:pets**: read your pets */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
# NAME
|
||||
|
||||
Something::Deep::Role - a Moose role for the Swagger Petstore */ ' \"
|
||||
Something::Deep::Role - a Moose role for the Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
# VERSION
|
||||
|
||||
Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0 */ ' \"
|
||||
- API version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-06-28T16:32:37.043+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
## A note on Moose
|
||||
|
||||
@@ -248,38 +247,40 @@ use Something::Deep::Object::ModelReturn;
|
||||
|
||||
# for displaying the API response data
|
||||
use Data::Dumper;
|
||||
use Something::Deep::Configuration;
|
||||
use Something::Deep::;
|
||||
|
||||
my $api_instance = Something::Deep::FakeApi->new();
|
||||
my $test code inject */ ' " =end = 'test code inject */ ' " =end_example'; # string | To test code injection */ ' \"
|
||||
my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
eval {
|
||||
$api_instance->test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end);
|
||||
$api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling FakeApi->test_code_inject____end: $@\n";
|
||||
warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n";
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
# DOCUMENTATION FOR API ENDPOINTS
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' " =end/v2 */ ' " =end*
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**test_code_inject____end**](docs/FakeApi.md#test_code_inject____end) | **PUT** /fake | To test code injection */ ' \"
|
||||
*FakeApi* | [**test_code_inject____end__rn_n_r**](docs/FakeApi.md#test_code_inject____end__rn_n_r) | **PUT** /fake | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
# DOCUMENTATION FOR MODELS
|
||||
- [Something::Deep::Object::ModelReturn](docs/ModelReturn.md)
|
||||
|
||||
|
||||
# DOCUMENTATION FOR AUTHORIATION
|
||||
# DOCUMENTATION FOR AUTHORIZATION
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
## petstore_auth
|
||||
@@ -288,8 +289,6 @@ Class | Method | HTTP request | Description
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- **write:pets**: modify pets in your account */ ' " =end
|
||||
- **read:pets**: read your pets */ ' " =end
|
||||
|
||||
|
||||
- **write:pets**: modify pets in your account */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- **read:pets**: read your pets */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
@@ -5,30 +5,32 @@
|
||||
use Something::Deep::Object::FakeApi;
|
||||
```
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' " =end/v2 */ ' " =end*
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**test_code_inject____end**](FakeApi.md#test_code_inject____end) | **PUT** /fake | To test code injection */ ' \"
|
||||
[**test_code_inject____end__rn_n_r**](FakeApi.md#test_code_inject____end__rn_n_r) | **PUT** /fake | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
# **test_code_inject____end**
|
||||
> test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end)
|
||||
# **test_code_inject____end__rn_n_r**
|
||||
> test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r)
|
||||
|
||||
To test code injection */ ' \"
|
||||
To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
use Something::Deep::Configuration;
|
||||
use Something::Deep::FakeApi;
|
||||
|
||||
my $api_instance = Something::Deep::FakeApi->new();
|
||||
my $test code inject */ ' " =end = 'test code inject */ ' " =end_example'; # string | To test code injection */ ' \"
|
||||
my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
eval {
|
||||
$api_instance->test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end);
|
||||
$api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling FakeApi->test_code_inject____end: $@\n";
|
||||
warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
@@ -36,7 +38,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**test code inject */ ' " =end** | **string**| To test code injection */ ' \" | [optional]
|
||||
**test code inject */ ' " =end __ \r\n \n \r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -48,8 +50,8 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, */ " =end
|
||||
- **Accept**: application/json, */ " =end
|
||||
- **Content-Type**: application/json, */ \" =_end --
|
||||
- **Accept**: application/json, */ \" =_end --
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use Something::Deep::Object::ModelReturn;
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**return** | **int** | property description */ ' \" | [optional]
|
||||
**return** | **int** | property description */ ' \" =_end -- \\r\\n \\n \\r | [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)
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -58,7 +46,7 @@ sub _new_instance
|
||||
my $class = shift;
|
||||
my (%args) = (
|
||||
'ua' => LWP::UserAgent->new,
|
||||
'base_url' => 'https://petstore.swagger.io */ ' " =end/v2 */ ' " =end',
|
||||
'base_url' => 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
@_
|
||||
);
|
||||
|
||||
@@ -352,9 +340,9 @@ sub update_params_for_auth {
|
||||
}
|
||||
elsif ($auth eq 'api_key') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('api_key */ ' " =end');
|
||||
my $api_key = $self->get_api_key_with_prefix('api_key */ ' " =end -- \r\n \n \r');
|
||||
if ($api_key) {
|
||||
$header_params->{'api_key */ ' " =end'} = $api_key;
|
||||
$header_params->{'api_key */ ' " =end -- \r\n \n \r'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'petstore_auth') {
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -42,7 +30,7 @@ use constant VERSION => '1.0.0';
|
||||
|
||||
# class/static variables
|
||||
our $http_timeout = 180;
|
||||
our $http_user_agent = 'Perl-Swagger';
|
||||
our $http_user_agent = 'Swagger-Codegen/1.0.0/perl';
|
||||
|
||||
# authentication setting
|
||||
our $api_key = {};
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -64,33 +52,32 @@ sub new {
|
||||
|
||||
|
||||
#
|
||||
# test_code_inject____end
|
||||
# test_code_inject____end__rn_n_r
|
||||
#
|
||||
# To test code injection */ ' \"
|
||||
# To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
#
|
||||
# @param string $test code inject */ ' " =end To test code injection */ ' \" (optional)
|
||||
# @param string $test code inject */ ' " =end __ \r\n \n \r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional)
|
||||
{
|
||||
my $params = {
|
||||
'test code inject */ ' " =end' => {
|
||||
'test code inject */ ' " =end __ \r\n \n \r' => {
|
||||
data_type => 'string',
|
||||
description => 'To test code injection */ ' \" ',
|
||||
description => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
required => '0',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ 'test_code_inject____end' } = {
|
||||
summary => 'To test code injection */ ' \" ',
|
||||
__PACKAGE__->method_documentation->{ 'test_code_inject____end__rn_n_r' } = {
|
||||
summary => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
params => $params,
|
||||
returns => undef,
|
||||
};
|
||||
}
|
||||
# @return void
|
||||
#
|
||||
sub test_code_inject____end {
|
||||
sub test_code_inject____end__rn_n_r {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/fake';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'PUT';
|
||||
my $query_params = {};
|
||||
@@ -98,15 +85,15 @@ sub test_code_inject____end {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', '*/ " =end');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', '*/ \" =_end -- ');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ " =end');
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ \" =_end -- ');
|
||||
|
||||
# form params
|
||||
if ( exists $args{'test code inject */ ' " =end'} ) {
|
||||
$form_params->{'test code inject */ ' " =end'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end'});
|
||||
if ( exists $args{'test code inject */ ' " =end __ \r\n \n \r'} ) {
|
||||
$form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end __ \r\n \n \r'});
|
||||
}
|
||||
|
||||
my $_body_data;
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -46,7 +34,7 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#Model for testing reserved words */ ' \"
|
||||
#Model for testing reserved words */ ' \" =_end -- \\r\\n \\n \\r
|
||||
#
|
||||
# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
# REF: https://github.com/swagger-api/swagger-codegen
|
||||
@@ -54,26 +42,14 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -160,7 +136,7 @@ sub _deserialize {
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing reserved words */ ' \" ',
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing reserved words */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
class => 'ModelReturn',
|
||||
required => [], # TODO
|
||||
} );
|
||||
@@ -169,7 +145,7 @@ __PACKAGE__->method_documentation({
|
||||
'return' => {
|
||||
datatype => 'int',
|
||||
base_name => 'return',
|
||||
description => 'property description */ ' \" ',
|
||||
description => 'property description */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -66,10 +54,9 @@ has _cfg => ( is => 'ro',
|
||||
has version_info => ( is => 'ro',
|
||||
isa => 'HashRef',
|
||||
default => sub { {
|
||||
app_name => 'Swagger Petstore */ ' \" ',
|
||||
app_version => '1.0.0 */ ' \" ',
|
||||
generated_date => '2016-06-28T16:32:37.043+08:00',
|
||||
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
|
||||
app_name => 'Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
app_version => '1.0.0 */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
generator_class => 'io.swagger.codegen.languages.PerlClientCodegen',
|
||||
} },
|
||||
documentation => 'Information about the application version and the codegen codebase version'
|
||||
);
|
||||
@@ -124,19 +111,16 @@ sub _build_af {
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Something::Deep::Role - a Moose role for the Swagger Petstore */ ' \"
|
||||
Something::Deep::Role - a Moose role for the Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
=head2 Swagger Petstore */ ' \" version: 1.0.0 */ ' \"
|
||||
=head2 Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Build date: 2016-06-28T16:32:37.043+08:00
|
||||
|
||||
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
=item Build package: io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
=item Codegen version:
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
|
||||
@@ -5,30 +5,32 @@
|
||||
use WWW::SwaggerClient::Object::FakeApi;
|
||||
```
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' " =end/v2 */ ' " =end*
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**test_code_inject____end**](FakeApi.md#test_code_inject____end) | **PUT** /fake | To test code injection */ ' \"
|
||||
[**test_code_inject____end__rn_n_r**](FakeApi.md#test_code_inject____end__rn_n_r) | **PUT** /fake | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
# **test_code_inject____end**
|
||||
> test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end)
|
||||
# **test_code_inject____end__rn_n_r**
|
||||
> test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r)
|
||||
|
||||
To test code injection */ ' \"
|
||||
To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
use WWW::SwaggerClient::Configuration;
|
||||
use WWW::SwaggerClient::FakeApi;
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::FakeApi->new();
|
||||
my $test code inject */ ' " =end = 'test code inject */ ' " =end_example'; # string | To test code injection */ ' \"
|
||||
my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
eval {
|
||||
$api_instance->test_code_inject____end(test code inject */ ' " =end => $test code inject */ ' " =end);
|
||||
$api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling FakeApi->test_code_inject____end: $@\n";
|
||||
warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
@@ -36,7 +38,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**test code inject */ ' " =end** | **string**| To test code injection */ ' \" | [optional]
|
||||
**test code inject */ ' " =end __ \r\n \n \r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -48,8 +50,8 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, */ " =end
|
||||
- **Accept**: application/json, */ " =end
|
||||
- **Content-Type**: application/json, */ \" =_end --
|
||||
- **Accept**: application/json, */ \" =_end --
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::ModelReturn;
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**return** | **int** | property description */ ' \" | [optional]
|
||||
**return** | **int** | property description */ ' \" =_end -- \\r\\n \\n \\r | [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)
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -58,7 +46,7 @@ sub _new_instance
|
||||
my $class = shift;
|
||||
my (%args) = (
|
||||
'ua' => LWP::UserAgent->new,
|
||||
'base_url' => 'https://petstore.swagger.io */ ' " =end/v2 */ ' " =end',
|
||||
'base_url' => 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
@_
|
||||
);
|
||||
|
||||
@@ -352,9 +340,9 @@ sub update_params_for_auth {
|
||||
}
|
||||
elsif ($auth eq 'api_key') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('api_key */ ' " =end');
|
||||
my $api_key = $self->get_api_key_with_prefix('api_key */ ' " =end -- \r\n \n \r');
|
||||
if ($api_key) {
|
||||
$header_params->{'api_key */ ' " =end'} = $api_key;
|
||||
$header_params->{'api_key */ ' " =end -- \r\n \n \r'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'petstore_auth') {
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -42,7 +30,7 @@ use constant VERSION => '1.0.0';
|
||||
|
||||
# class/static variables
|
||||
our $http_timeout = 180;
|
||||
our $http_user_agent = 'Perl-Swagger';
|
||||
our $http_user_agent = 'Swagger-Codegen/1.0.0/perl';
|
||||
|
||||
# authentication setting
|
||||
our $api_key = {};
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -64,33 +52,32 @@ sub new {
|
||||
|
||||
|
||||
#
|
||||
# test_code_inject____end
|
||||
# test_code_inject____end__rn_n_r
|
||||
#
|
||||
# To test code injection */ ' \"
|
||||
# To test code injection */ ' \" =_end -- \\r\\n \\n \\r
|
||||
#
|
||||
# @param string $test code inject */ ' " =end To test code injection */ ' \" (optional)
|
||||
# @param string $test code inject */ ' " =end __ \r\n \n \r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional)
|
||||
{
|
||||
my $params = {
|
||||
'test code inject */ ' " =end' => {
|
||||
'test code inject */ ' " =end __ \r\n \n \r' => {
|
||||
data_type => 'string',
|
||||
description => 'To test code injection */ ' \" ',
|
||||
description => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
required => '0',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ 'test_code_inject____end' } = {
|
||||
summary => 'To test code injection */ ' \" ',
|
||||
__PACKAGE__->method_documentation->{ 'test_code_inject____end__rn_n_r' } = {
|
||||
summary => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
params => $params,
|
||||
returns => undef,
|
||||
};
|
||||
}
|
||||
# @return void
|
||||
#
|
||||
sub test_code_inject____end {
|
||||
sub test_code_inject____end__rn_n_r {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/fake';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'PUT';
|
||||
my $query_params = {};
|
||||
@@ -98,15 +85,15 @@ sub test_code_inject____end {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', '*/ " =end');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', '*/ \" =_end -- ');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ " =end');
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ \" =_end -- ');
|
||||
|
||||
# form params
|
||||
if ( exists $args{'test code inject */ ' " =end'} ) {
|
||||
$form_params->{'test code inject */ ' " =end'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end'});
|
||||
if ( exists $args{'test code inject */ ' " =end __ \r\n \n \r'} ) {
|
||||
$form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end __ \r\n \n \r'});
|
||||
}
|
||||
|
||||
my $_body_data;
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -46,7 +34,7 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#Model for testing reserved words */ ' \"
|
||||
#Model for testing reserved words */ ' \" =_end -- \\r\\n \\n \\r
|
||||
#
|
||||
# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
# REF: https://github.com/swagger-api/swagger-codegen
|
||||
@@ -54,26 +42,14 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -160,7 +136,7 @@ sub _deserialize {
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing reserved words */ ' \" ',
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing reserved words */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
class => 'ModelReturn',
|
||||
required => [], # TODO
|
||||
} );
|
||||
@@ -169,7 +145,7 @@ __PACKAGE__->method_documentation({
|
||||
'return' => {
|
||||
datatype => 'int',
|
||||
base_name => 'return',
|
||||
description => 'property description */ ' \" ',
|
||||
description => 'property description */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
@@ -66,10 +54,9 @@ has _cfg => ( is => 'ro',
|
||||
has version_info => ( is => 'ro',
|
||||
isa => 'HashRef',
|
||||
default => sub { {
|
||||
app_name => 'Swagger Petstore */ ' \" ',
|
||||
app_version => '1.0.0 */ ' \" ',
|
||||
generated_date => '2016-06-28T16:32:36.006+08:00',
|
||||
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
|
||||
app_name => 'Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
app_version => '1.0.0 */ ' \" =_end -- \\r\\n \\n \\r',
|
||||
generator_class => 'io.swagger.codegen.languages.PerlClientCodegen',
|
||||
} },
|
||||
documentation => 'Information about the application version and the codegen codebase version'
|
||||
);
|
||||
@@ -124,19 +111,16 @@ sub _build_af {
|
||||
|
||||
=head1 NAME
|
||||
|
||||
WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore */ ' \"
|
||||
WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
=head2 Swagger Petstore */ ' \" version: 1.0.0 */ ' \"
|
||||
=head2 Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Build date: 2016-06-28T16:32:36.006+08:00
|
||||
|
||||
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
=item Build package: io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
=item Codegen version:
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
=begin comment
|
||||
|
||||
Swagger Petstore */ ' \"
|
||||
Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \"
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \"
|
||||
Contact: apiteam@swagger.io */ ' \"
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end comment
|
||||
|
||||
=cut
|
||||
|
||||
@@ -98,7 +98,6 @@ class FakeApi(object):
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
resource_path = '/fake'.replace('{format}', 'json')
|
||||
path_params = {}
|
||||
|
||||
query_params = {}
|
||||
@@ -122,7 +121,7 @@ class FakeApi(object):
|
||||
# Authentication setting
|
||||
auth_settings = []
|
||||
|
||||
return self.api_client.call_api(resource_path, 'PUT',
|
||||
return self.api_client.call_api('/fake', 'PUT',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
|
||||
@@ -34,8 +34,7 @@ class Configuration(object):
|
||||
Constructor
|
||||
"""
|
||||
# Default Base url
|
||||
self.host = "https://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r"
|
||||
|
||||
self.host = "https://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r"
|
||||
# Temp file folder for downloading files
|
||||
self.temp_folder_path = None
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "SWGFakeApi.h"
|
||||
@@ -40,7 +28,7 @@ SWGFakeApi::SWGFakeApi(QString host, QString basePath) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGFakeApi::testCodeInject */ ' " =end \r\n \n \r(QString* test code inject */ ' " =end \r\n \n \r) {
|
||||
SWGFakeApi::testCodeInject */ ' " =end \r\n \n \r(QString* test_code_inject____end____rn_n_r) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/fake");
|
||||
|
||||
@@ -49,8 +37,8 @@ SWGFakeApi::testCodeInject */ ' " =end \r\n \n \r(QString* test co
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
if (test code inject */ ' " =end \r\n \n \r != NULL) {
|
||||
input.add_var("test code inject */ ' " =end \r\n \n \r", *test code inject */ ' " =end \r\n \n \r);
|
||||
if (test_code_inject____end____rn_n_r != nullptr) {
|
||||
input.add_var("test code inject */ ' " =end -- \r\n \n \r", *test_code_inject____end____rn_n_r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _SWG_SWGFakeApi_H_
|
||||
@@ -44,7 +32,7 @@ public:
|
||||
QString host;
|
||||
QString basePath;
|
||||
|
||||
void testCodeInject */ ' " =end \r\n \n \r(QString* test code inject */ ' " =end \r\n \n \r);
|
||||
void testCodeInject */ ' " =end \r\n \n \r(QString* test_code_inject____end____rn_n_r);
|
||||
|
||||
private:
|
||||
void testCodeInject */ ' " =end \r\n \n \rCallback (HttpRequestWorker * worker);
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
@@ -28,12 +16,13 @@
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonValue>
|
||||
#include <QDateTime>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
void
|
||||
setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
if(value == NULL) {
|
||||
if(value == nullptr) {
|
||||
// can't set value with a null pointer
|
||||
return;
|
||||
}
|
||||
@@ -60,7 +49,7 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
else if (QStringLiteral("QString").compare(type) == 0) {
|
||||
QString **val = static_cast<QString**>(value);
|
||||
|
||||
if(val != NULL) {
|
||||
if(val != nullptr) {
|
||||
if(!obj.isNull()) {
|
||||
// create a new value and return
|
||||
delete *val;
|
||||
@@ -68,19 +57,19 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// set target to NULL
|
||||
// set target to nullptr
|
||||
delete *val;
|
||||
*val = NULL;
|
||||
*val = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Can't set value because the target pointer is NULL";
|
||||
qDebug() << "Can't set value because the target pointer is nullptr";
|
||||
}
|
||||
}
|
||||
else if (QStringLiteral("QDateTime").compare(type) == 0) {
|
||||
QDateTime **val = static_cast<QDateTime**>(value);
|
||||
|
||||
if(val != NULL) {
|
||||
if(val != nullptr) {
|
||||
if(!obj.isNull()) {
|
||||
// create a new value and return
|
||||
delete *val;
|
||||
@@ -88,19 +77,19 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// set target to NULL
|
||||
// set target to nullptr
|
||||
delete *val;
|
||||
*val = NULL;
|
||||
*val = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Can't set value because the target pointer is NULL";
|
||||
qDebug() << "Can't set value because the target pointer is nullptr";
|
||||
}
|
||||
}
|
||||
else if (QStringLiteral("QDate").compare(type) == 0) {
|
||||
QDate **val = static_cast<QDate**>(value);
|
||||
|
||||
if(val != NULL) {
|
||||
if(val != nullptr) {
|
||||
if(!obj.isNull()) {
|
||||
// create a new value and return
|
||||
delete *val;
|
||||
@@ -108,20 +97,41 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// set target to NULL
|
||||
// set target to nullptr
|
||||
delete *val;
|
||||
*val = NULL;
|
||||
*val = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Can't set value because the target pointer is NULL";
|
||||
qDebug() << "Can't set value because the target pointer is nullptr";
|
||||
}
|
||||
}
|
||||
else if (QStringLiteral("QByteArray").compare(type) == 0) {
|
||||
QByteArray **val = static_cast<QByteArray**>(value);
|
||||
|
||||
if(val != nullptr) {
|
||||
if(!obj.isNull()) {
|
||||
// create a new value and return
|
||||
delete *val;
|
||||
|
||||
*val = new QByteArray(QByteArray::fromBase64(QByteArray::fromStdString(obj.toString().toStdString())));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// set target to nullptr
|
||||
delete *val;
|
||||
*val = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Can't set value because the target pointer is nullptr";
|
||||
}
|
||||
}
|
||||
else if(type.startsWith("SWG") && obj.isObject()) {
|
||||
// complex type
|
||||
QJsonObject jsonObj = obj.toObject();
|
||||
SWGObject * so = (SWGObject*)Swagger::create(type);
|
||||
if(so != NULL) {
|
||||
if(so != nullptr) {
|
||||
so->fromJsonObject(jsonObj);
|
||||
SWGObject **val = static_cast<SWGObject**>(value);
|
||||
delete *val;
|
||||
@@ -169,19 +179,19 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
output->append((void*)&val);
|
||||
}
|
||||
else if(QStringLiteral("QString").compare(complexType) == 0) {
|
||||
QString val;
|
||||
QString * val = new QString();
|
||||
setValue(&val, jval, QStringLiteral("QString"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
output->append((void*)val);
|
||||
}
|
||||
else if(QStringLiteral("QDate").compare(complexType) == 0) {
|
||||
QDate val;
|
||||
QDate * val = new QDate();
|
||||
setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
output->append((void*)val);
|
||||
}
|
||||
else if(QStringLiteral("QDateTime").compare(complexType) == 0) {
|
||||
QDateTime val;
|
||||
QDateTime * val = new QDateTime();
|
||||
setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
output->append((void*)val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,14 +203,14 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
|
||||
void
|
||||
toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
|
||||
if(value == NULL) {
|
||||
if(value == nullptr) {
|
||||
return;
|
||||
}
|
||||
if(type.startsWith("SWG")) {
|
||||
SWGObject *swgObject = reinterpret_cast<SWGObject *>(value);
|
||||
if(swgObject != NULL) {
|
||||
if(swgObject != nullptr) {
|
||||
QJsonObject* o = (*swgObject).asJsonObject();
|
||||
if(name != NULL) {
|
||||
if(name != nullptr) {
|
||||
output->insert(name, *o);
|
||||
delete o;
|
||||
}
|
||||
@@ -244,6 +254,10 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
|
||||
QDateTime* datetime = static_cast<QDateTime*>(value);
|
||||
output->insert(name, QJsonValue(datetime->toString(Qt::ISODate)));
|
||||
}
|
||||
else if(QStringLiteral("QByteArray").compare(type) == 0) {
|
||||
QByteArray* byteArray = static_cast<QByteArray*>(value);
|
||||
output->insert(name, QJsonValue(QString(byteArray->toBase64())));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -251,7 +265,7 @@ toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString
|
||||
foreach(void* obj, *value) {
|
||||
QJsonObject element;
|
||||
|
||||
toJsonValue(NULL, obj, &element, innerType);
|
||||
toJsonValue(nullptr, obj, &element, innerType);
|
||||
output->append(element);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SWGHELPERS_H
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "SWGHttpRequest.h"
|
||||
@@ -60,7 +48,7 @@ void HttpRequestInput::add_file(QString variable_name, QString local_filename, Q
|
||||
|
||||
|
||||
HttpRequestWorker::HttpRequestWorker(QObject *parent)
|
||||
: QObject(parent), manager(NULL)
|
||||
: QObject(parent), manager(nullptr)
|
||||
{
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
|
||||
@@ -204,8 +192,8 @@ void HttpRequestWorker::execute(HttpRequestInput *input) {
|
||||
|
||||
// ensure necessary variables are available
|
||||
if (
|
||||
file_info->local_filename == NULL || file_info->local_filename.isEmpty()
|
||||
|| file_info->variable_name == NULL || file_info->variable_name.isEmpty()
|
||||
file_info->local_filename == nullptr || file_info->local_filename.isEmpty()
|
||||
|| file_info->variable_name == nullptr || file_info->variable_name.isEmpty()
|
||||
|| !fi.exists() || !fi.isFile() || !fi.isReadable()
|
||||
) {
|
||||
// silent abort for the current file
|
||||
@@ -219,7 +207,7 @@ void HttpRequestWorker::execute(HttpRequestInput *input) {
|
||||
}
|
||||
|
||||
// ensure filename for the request
|
||||
if (file_info->request_filename == NULL || file_info->request_filename.isEmpty()) {
|
||||
if (file_info->request_filename == nullptr || file_info->request_filename.isEmpty()) {
|
||||
file_info->request_filename = fi.fileName();
|
||||
if (file_info->request_filename.isEmpty()) {
|
||||
file_info->request_filename = "file";
|
||||
@@ -238,7 +226,7 @@ void HttpRequestWorker::execute(HttpRequestInput *input) {
|
||||
));
|
||||
request_content.append(new_line);
|
||||
|
||||
if (file_info->mime_type != NULL && !file_info->mime_type.isEmpty()) {
|
||||
if (file_info->mime_type != nullptr && !file_info->mime_type.isEmpty()) {
|
||||
request_content.append("Content-Type: ");
|
||||
request_content.append(file_info->mime_type);
|
||||
request_content.append(new_line);
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ModelFactory_H_
|
||||
@@ -34,19 +22,19 @@ namespace Swagger {
|
||||
return new SWGReturn();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline void* create(QString json, QString type) {
|
||||
void* val = create(type);
|
||||
if(val != NULL) {
|
||||
if(val != nullptr) {
|
||||
SWGObject* obj = static_cast<SWGObject*>(val);
|
||||
return obj->fromJson(json);
|
||||
}
|
||||
if(type.startsWith("QString")) {
|
||||
return new QString();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _SWG_OBJECT_H_
|
||||
@@ -30,12 +18,12 @@
|
||||
class SWGObject {
|
||||
public:
|
||||
virtual QJsonObject* asJsonObject() {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
virtual ~SWGObject() {}
|
||||
virtual SWGObject* fromJson(QString &jsonString) {
|
||||
Q_UNUSED(jsonString);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
virtual void fromJsonObject(QJsonObject &json) {
|
||||
Q_UNUSED(json);
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
@@ -69,7 +57,7 @@ SWGReturn::fromJson(QString &json) {
|
||||
|
||||
void
|
||||
SWGReturn::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&return, pJson["return"], "qint32", "");
|
||||
::Swagger::setValue(&return, pJson["return"], "qint32", "");
|
||||
}
|
||||
|
||||
QString
|
||||
@@ -85,6 +73,7 @@ SWGReturn::asJson ()
|
||||
QJsonObject*
|
||||
SWGReturn::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
|
||||
obj->insert("return", QJsonValue(return));
|
||||
|
||||
return obj;
|
||||
|
||||
@@ -1,31 +1,19 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGReturn.h
|
||||
*
|
||||
* Model for testing reserved words *_/ ' \" =end \\r\\n \\n \\r
|
||||
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
|
||||
#ifndef SWGReturn_H_
|
||||
@@ -56,6 +44,7 @@ public:
|
||||
qint32 getReturn();
|
||||
void setReturn(qint32 return);
|
||||
|
||||
|
||||
private:
|
||||
qint32 return;
|
||||
};
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
# 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.
|
||||
|
||||
*.gem
|
||||
*.rbc
|
||||
|
||||
7
samples/client/petstore-security-test/ruby/Gemfile
Normal file
7
samples/client/petstore-security-test/ruby/Gemfile
Normal file
@@ -0,0 +1,7 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gemspec
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake', '~> 12.0.0'
|
||||
end
|
||||
@@ -8,8 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
||||
|
||||
- API version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-08-29T14:24:34.432-07:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -87,6 +86,12 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
@@ -96,9 +101,3 @@ Class | Method | HTTP request | Description
|
||||
- write:pets: modify pets in your account */ ' \" =_end -- \\r\\n \\n \\r
|
||||
- read:pets: read your pets */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
||||
8
samples/client/petstore-security-test/ruby/Rakefile
Normal file
8
samples/client/petstore-security-test/ruby/Rakefile
Normal file
@@ -0,0 +1,8 @@
|
||||
begin
|
||||
require 'rspec/core/rake_task'
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
task default: :spec
|
||||
rescue LoadError
|
||||
# no rspec available
|
||||
end
|
||||
@@ -2,18 +2,6 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
# Common files
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
require "uri"
|
||||
@@ -51,21 +39,17 @@ module Petstore
|
||||
@api_client.config.logger.debug "Calling API: FakeApi.test_code_inject____end__rn_n_r ..."
|
||||
end
|
||||
# resource path
|
||||
local_var_path = "/fake".sub('{format}','json')
|
||||
local_var_path = "/fake"
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', '*/ \" =_end -- ']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/ \" =_end -- '])
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = ['application/json', '*/ \" =_end -- ']
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', '*/ \" =_end -- '])
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
@@ -142,10 +130,11 @@ module Petstore
|
||||
# application/json
|
||||
# application/json; charset=UTF8
|
||||
# APPLICATION/JSON
|
||||
# */*
|
||||
# @param [String] mime MIME
|
||||
# @return [Boolean] True if the MIME is application/json
|
||||
def json_mime?(mime)
|
||||
!(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
||||
(mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
||||
end
|
||||
|
||||
# Deserialize the response to the given return type.
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
module Petstore
|
||||
@@ -32,12 +20,14 @@ module Petstore
|
||||
# ApiError.new(:code => 404, :message => "Not Found")
|
||||
def initialize(arg = nil)
|
||||
if arg.is_a? Hash
|
||||
arg.each do |k, v|
|
||||
if k.to_s == 'message'
|
||||
super v
|
||||
if arg.key?(:message) || arg.key?('message')
|
||||
super(arg[:message] || arg['message'])
|
||||
else
|
||||
instance_variable_set "@#{k}", v
|
||||
super arg
|
||||
end
|
||||
|
||||
arg.each do |k, v|
|
||||
instance_variable_set "@#{k}", v
|
||||
end
|
||||
else
|
||||
super arg
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
require 'uri'
|
||||
@@ -201,13 +189,6 @@ module Petstore
|
||||
# Returns Auth Settings hash for api client.
|
||||
def auth_settings
|
||||
{
|
||||
'petstore_auth' =>
|
||||
{
|
||||
type: 'oauth2',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: "Bearer #{access_token}"
|
||||
},
|
||||
'api_key' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
@@ -215,6 +196,13 @@ module Petstore
|
||||
key: 'api_key */ ' " =end -- \r\n \n \r',
|
||||
value: api_key_with_prefix('api_key */ ' " =end -- \r\n \n \r')
|
||||
},
|
||||
'petstore_auth' =>
|
||||
{
|
||||
type: 'oauth2',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: "Bearer #{access_token}"
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
@@ -97,7 +85,7 @@ module Petstore
|
||||
def build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
self.class.swagger_types.each_pair do |key, type|
|
||||
if type =~ /^Array<(.*)>/i
|
||||
if type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||
@@ -128,7 +116,7 @@ module Petstore
|
||||
when :Float
|
||||
value.to_f
|
||||
when :BOOLEAN
|
||||
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
@@ -139,7 +127,7 @@ module Petstore
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
|
||||
@@ -7,18 +7,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
module Petstore
|
||||
|
||||
@@ -9,18 +9,6 @@ OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
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.
|
||||
|
||||
=end
|
||||
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
@@ -35,7 +23,9 @@ Gem::Specification.new do |s|
|
||||
s.homepage = "https://github.com/swagger-api/swagger-codegen"
|
||||
s.summary = "Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r Ruby Gem"
|
||||
s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end -- "
|
||||
s.license = "Apache 2.0 */ ' \" =_end -- \\r\\n \\n \\r"
|
||||
# TODO uncommnet and update below with a proper license
|
||||
#s.license = "Apache 2.0"
|
||||
s.required_ruby_version = ">= 1.9"
|
||||
|
||||
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
||||
s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3'
|
||||
|
||||
@@ -156,6 +156,11 @@
|
||||
<artifactId>jackson-module-scala_2.10</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-joda</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
@@ -210,7 +215,7 @@
|
||||
<joda-version>1.2</joda-version>
|
||||
<joda-time-version>2.2</joda-time-version>
|
||||
<jersey-version>1.19</jersey-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<swagger-core-version>1.5.12</swagger-core-version>
|
||||
<jersey-async-version>1.0.5</jersey-async-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
<jackson-version>2.4.2</jackson-version>
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart
|
||||
|
||||
import java.io.File
|
||||
import java.net.URLEncoder
|
||||
import java.util.UUID
|
||||
import javax.ws.rs.core.MediaType
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
@@ -66,6 +67,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
|
||||
def escape(value: Long): String = value.toString
|
||||
def escape(value: Double): String = value.toString
|
||||
def escape(value: Float): String = value.toString
|
||||
def escape(value: UUID): String = value.toString
|
||||
|
||||
def deserialize(json: String, containerType: String, cls: Class[_]) = {
|
||||
if (cls == classOf[String]) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Date
|
||||
|
||||
import scala.collection.mutable.HashMap
|
||||
|
||||
class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r",
|
||||
class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r",
|
||||
defApiInvoker: ApiInvoker = ApiInvoker) {
|
||||
var basePath = defBasePath
|
||||
var apiInvoker = defApiInvoker
|
||||
|
||||
@@ -15,5 +15,6 @@ package io.swagger.client.model
|
||||
|
||||
case class ModelReturn (
|
||||
/* property description *_/ ' \" =end -- \\r\\n \\n \\r */
|
||||
_return: Integer
|
||||
_return: Option[Integer]
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as api from './api/api';
|
||||
import * as angular from 'angular';
|
||||
|
||||
const apiModule = angular.module('api', [])
|
||||
.service('FakeApi', api.FakeApi)
|
||||
|
||||
export default apiModule;
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import * as models from '../model/models';
|
||||
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
export class FakeApi {
|
||||
protected basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||
public defaultHeaders : any = {};
|
||||
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer', 'basePath'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
public testCodeInjectEndRnNR (test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||
const localVarPath = this.basePath + '/fake';
|
||||
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
|
||||
let formParams: any = {};
|
||||
|
||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
formParams['test code inject */ ' " =end -- \r\n \n \r'] = test code inject * ' " =end rn n r;
|
||||
|
||||
let httpRequestParams: ng.IRequestConfig = {
|
||||
method: 'PUT',
|
||||
url: localVarPath,
|
||||
data: this.$httpParamSerializer(formParams),
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
|
||||
if (extraHttpRequestParams) {
|
||||
httpRequestParams = (<any>Object).assign(httpRequestParams, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.$http(httpRequestParams);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './FakeApi';
|
||||
import { FakeApi } from './FakeApi';
|
||||
export const APIS = [ FakeApi, ];
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user