better handling of multiline comments for all lang

This commit is contained in:
wing328
2016-07-02 16:25:55 +08:00
parent 3c9b172996
commit 2464633368
41 changed files with 301 additions and 68 deletions

View File

@@ -665,7 +665,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -842,7 +842,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -311,4 +311,15 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
public Boolean getSupportsES6() {
return supportsES6;
}
@Override
public String escapeQuotationMark(String input) {
// remove ', " to avoid code injection
return input.replace("\"", "").replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -414,4 +414,14 @@ public class AkkaScalaClientCodegen extends DefaultCodegen implements CodegenCon
}
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -504,4 +504,15 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
this.sourceFolder = sourceFolder;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -212,4 +212,16 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
protected String namespaceToFolder(String ns) {
return ns.replace(".", File.separator).replace("-", "_");
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
// ref: https://clojurebridge.github.io/community-docs/docs/clojure/comment/
return input.replace("(comment", "(_comment");
}
}

View File

@@ -377,4 +377,16 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi
public String toApiName(String type) {
return Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api";
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -274,4 +274,15 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
return camelize(operationId);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -289,4 +289,16 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -373,4 +373,15 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -452,4 +452,15 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
public void setPackageVersion(String packageVersion) {
this.packageVersion = packageVersion;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -263,4 +263,16 @@ public class GoServerCodegen extends DefaultCodegen implements CodegenConfig {
// e.g. PetApi.go => pet_api.go
return underscore(name);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -83,4 +83,14 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
this.configPackage = configPackage;
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection
return input.replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -491,4 +491,16 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
p.dataType = fixModelChars(p.dataType);
return p;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("{-", "{_-").replace("-}", "-_}");
}
}

View File

@@ -183,4 +183,16 @@ public class JMeterCodegen extends DefaultCodegen implements CodegenConfig {
type = swaggerType;
return toModelName(type);
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection
return input.replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -1041,7 +1041,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -254,7 +254,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -235,7 +235,7 @@ public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -723,5 +723,15 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
p.example = example;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -413,6 +413,6 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String escapeUnsafeCharacters(String input) {
// remove =end, =cut to avoid code injection
return input.replace("=end", "").replace("=cut", "");
return input.replace("=begin", "=_begin").replace("=end", "=_end").replace("=cut", "=_cut").replace("=pod", "=_pod");
}
}

View File

@@ -658,6 +658,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation op : operationList) {
// for API test method name
// e.g. public function test{{vendorExtensions.x-testOperationId}}()
op.vendorExtensions.put("x-testOperationId", camelize(op.operationId));
}
return objs;
@@ -671,7 +673,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -599,7 +599,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
@Override
public String escapeUnsafeCharacters(String input) {
// remove multiline comment
return input.replace("'''", "");
return input.replace("'''", "'_'_'");
}
}

View File

@@ -333,4 +333,15 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig {
public String toApiName(String type) {
return PREFIX + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api";
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -317,4 +317,14 @@ public class Rails5ServerCodegen extends DefaultCodegen implements CodegenConfig
return super.postProcessSupportingFileData(objs);
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection
return input.replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("=end", "=_end").replace("=begin", "=_begin");
}
}

View File

@@ -721,6 +721,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("=end", "");
return input.replace("=end", "=_end").replace("=begin", "=_begin");
}
}

View File

@@ -336,4 +336,15 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
return toModelName(name);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -196,4 +196,16 @@ public class ScalatraServerCodegen extends DefaultCodegen implements CodegenConf
}
return toModelName(type);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -208,7 +208,6 @@ public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -243,4 +243,14 @@ public class SinatraServerCodegen extends DefaultCodegen implements CodegenConfi
return super.postProcessSupportingFileData(objs);
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection
return input.replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("=end", "=_end").replace("=begin", "=_begin");
}
}

View File

@@ -550,4 +550,15 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
return postProcessModelsEnum(objs);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -281,4 +281,14 @@ public class TizenClientCodegen extends DefaultCodegen implements CodegenConfig
return camelize(operationId, true);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
}

View File

@@ -1,10 +1,10 @@
# SwaggerClient-php
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
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0 &#39; \&quot; &#x3D;end
- Build date: 2016-06-30T07:09:53.488+02:00
- API version: 1.0.0 *_/ &#39; \&quot; &#x3D;end
- Build date: 2016-07-02T16:22:07.280+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@@ -58,7 +58,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\FakeApi();
$test_code_inject____end = "test_code_inject____end_example"; // string | To test code injection ' \" =end
$test_code_inject____end = "test_code_inject____end_example"; // string | To test code injection *_/ ' \" =end
try {
$api_instance->testCodeInjectEnd($test_code_inject____end);
@@ -71,11 +71,11 @@ try {
## Documentation for API Endpoints
All URIs are relative to *https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end*
All URIs are relative to *https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end/v2 *_/ &#39; \&quot; &#x3D;end*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FakeApi* | [**testCodeInjectEnd**](docs/Api/FakeApi.md#testcodeinjectend) | **PUT** /fake | To test code injection &#39; \&quot; &#x3D;end
*FakeApi* | [**testCodeInjectEnd**](docs/Api/FakeApi.md#testcodeinjectend) | **PUT** /fake | To test code injection *_/ &#39; \&quot; &#x3D;end
## Documentation For Models
@@ -86,6 +86,12 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key */ ' " =end
- **Location**: HTTP header
## petstore_auth
- **Type**: OAuth
@@ -95,15 +101,9 @@ Class | Method | HTTP request | Description
- **write:pets**: modify pets in your account */ ' " =end
- **read:pets**: read your pets */ ' " =end
## api_key
- **Type**: API key
- **API key parameter name**: api_key */ ' " =end
- **Location**: HTTP header
## Author
apiteam@swagger.io &#39; \&quot; &#x3D;end
apiteam@swagger.io *_/ &#39; \&quot; &#x3D;end

View File

@@ -1,12 +1,12 @@
<?php
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@@ -1,16 +1,16 @@
# Swagger\Client\FakeApi
All URIs are relative to *https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end*
All URIs are relative to *https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end/v2 *_/ &#39; \&quot; &#x3D;end*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection &#39; \&quot; &#x3D;end
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection *_/ &#39; \&quot; &#x3D;end
# **testCodeInjectEnd**
> testCodeInjectEnd($test_code_inject____end)
To test code injection ' \" =end
To test code injection *_/ ' \" =end
### Example
```php
@@ -18,7 +18,7 @@ To test code injection ' \" =end
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\FakeApi();
$test_code_inject____end = "test_code_inject____end_example"; // string | To test code injection ' \" =end
$test_code_inject____end = "test_code_inject____end_example"; // string | To test code injection *_/ ' \" =end
try {
$api_instance->testCodeInjectEnd($test_code_inject____end);
@@ -32,7 +32,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**test_code_inject____end** | **string**| To test code injection &#39; \&quot; &#x3D;end | [optional]
**test_code_inject____end** | **string**| To test code injection *_/ &#39; \&quot; &#x3D;end | [optional]
### Return type

View File

@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**return** | **int** | property description &#39; \&quot; &#x3D;end | [optional]
**return** | **int** | property description *_/ &#39; \&quot; &#x3D;end | [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)

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ class FakeApi
{
if ($apiClient == null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end');
$apiClient->getConfig()->setHost('https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end/v2 *_/ &#39; \&quot; &#x3D;end');
}
$this->apiClient = $apiClient;
@@ -105,9 +105,9 @@ class FakeApi
/**
* Operation testCodeInjectEnd
*
* To test code injection ' \" =end
* To test code injection *_/ ' \" =end
*
* @param string $test_code_inject____end To test code injection &#39; \&quot; &#x3D;end (optional)
* @param string $test_code_inject____end To test code injection *_/ &#39; \&quot; &#x3D;end (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
@@ -120,9 +120,9 @@ class FakeApi
/**
* Operation testCodeInjectEndWithHttpInfo
*
* To test code injection ' \" =end
* To test code injection *_/ ' \" =end
*
* @param string $test_code_inject____end To test code injection &#39; \&quot; &#x3D;end (optional)
* @param string $test_code_inject____end To test code injection *_/ &#39; \&quot; &#x3D;end (optional)
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response
*/

View File

@@ -12,12 +12,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -102,7 +102,7 @@ class Configuration
*
* @var string
*/
protected $host = 'https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end';
protected $host = 'https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end/v2 *_/ &#39; \&quot; &#x3D;end';
/**
* Timeout (second) of the HTTP request, by default set to 0, no timeout
@@ -522,7 +522,7 @@ class Configuration
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . phpversion() . PHP_EOL;
$report .= ' OpenAPI Spec Version: 1.0.0 &#39; \&quot; &#x3D;end' . PHP_EOL;
$report .= ' OpenAPI Spec Version: 1.0.0 *_/ &#39; \&quot; &#x3D;end' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;

View File

@@ -12,12 +12,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -47,7 +47,7 @@ use \ArrayAccess;
* ModelReturn Class Doc Comment
*
* @category Class */
// @description Model for testing reserved words &#39; \&quot; &#x3D;end
// @description Model for testing reserved words *_/ &#39; \&quot; &#x3D;end
/**
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
@@ -167,7 +167,7 @@ class ModelReturn implements ArrayAccess
/**
* Sets return
* @param int $return property description ' \" =end
* @param int $return property description *_/ ' \" =end
* @return $this
*/
public function setReturn($return)

View File

@@ -12,12 +12,12 @@
*/
/**
* Swagger Petstore ' \" =end
* Swagger Petstore *_/ ' \" =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
* 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
* Contact: apiteam@swagger.io ' \" =end
* OpenAPI spec version: 1.0.0 *_/ ' \" =end
* Contact: apiteam@swagger.io *_/ ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -264,7 +264,7 @@ class ObjectSerializer
} else {
return null;
}
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
settype($data, $class);
return $data;
} elseif ($class === '\SplFileObject') {