forked from loafle/openapi-generator-original
Update JS petstore with OAS2, fix example values (#168)
* restore js petstore from codegen 2x * update js petstore with oas2, fix example values * remove comment code in js generator
This commit is contained in:
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
@@ -28,11 +29,9 @@ Test serialization of outer boolean types
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body
|
||||
var opts = {
|
||||
'booleanPostBody': true // Boolean | Input boolean as post body
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -47,7 +46,7 @@ apiInstance.fakeOuterBooleanSerialize(opts, callback);
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional]
|
||||
**booleanPostBody** | **Boolean**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -60,7 +59,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterCompositeSerialize"></a>
|
||||
# **fakeOuterCompositeSerialize**
|
||||
@@ -75,11 +74,9 @@ Test serialization of object with outer number type
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
||||
var opts = {
|
||||
'outerComposite': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -94,7 +91,7 @@ apiInstance.fakeOuterCompositeSerialize(opts, callback);
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -107,7 +104,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterNumberSerialize"></a>
|
||||
# **fakeOuterNumberSerialize**
|
||||
@@ -122,11 +119,9 @@ Test serialization of outer number types
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body
|
||||
var opts = {
|
||||
'body': 3.4 // Number | Input number as post body
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -141,7 +136,7 @@ apiInstance.fakeOuterNumberSerialize(opts, callback);
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional]
|
||||
**body** | **Number**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -154,7 +149,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterStringSerialize"></a>
|
||||
# **fakeOuterStringSerialize**
|
||||
@@ -169,11 +164,9 @@ Test serialization of outer string types
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body
|
||||
var opts = {
|
||||
'body': "body_example" // String | Input string as post body
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -188,7 +181,7 @@ apiInstance.fakeOuterStringSerialize(opts, callback);
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterString**](OuterString.md)| Input string as post body | [optional]
|
||||
**body** | **String**| Input string as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -201,11 +194,54 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
var query = "query_example"; // String |
|
||||
var user = new SwaggerPetstore.User(); // User |
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
};
|
||||
apiInstance.testBodyWithQueryParams(query, user, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**query** | **String**| |
|
||||
**user** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
> Client testClientModel(client)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
@@ -216,10 +252,7 @@ To test \"client\" model
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var body = new SwaggerPetstore.Client(); // Client | client model
|
||||
|
||||
|
||||
var client = new SwaggerPetstore.Client(); // Client | client model
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -227,14 +260,14 @@ var callback = function(error, data, response) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
apiInstance.testClientModel(body, callback);
|
||||
apiInstance.testClientModel(client, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -268,28 +301,22 @@ http_basic_test.username = 'YOUR USERNAME';
|
||||
http_basic_test.password = 'YOUR PASSWORD';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var _number = 8.14; // Number | None
|
||||
|
||||
var _double = 1.2; // Number | None
|
||||
|
||||
var _number = 3.4; // Number | None
|
||||
var _double = 3.4; // Number | None
|
||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
var _byte = B; // Blob | None
|
||||
|
||||
var opts = {
|
||||
var _byte = null; // Blob | None
|
||||
var opts = {
|
||||
'integer': 56, // Number | None
|
||||
'int32': 56, // Number | None
|
||||
'int64': 789, // Number | None
|
||||
'_float': 3.4, // Number | None
|
||||
'_string': "_string_example", // String | None
|
||||
'binary': B, // Blob | None
|
||||
'binary': "/path/to/file", // File | None
|
||||
'_date': new Date("2013-10-20"), // Date | None
|
||||
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None
|
||||
'password': "password_example", // String | None
|
||||
'callback': "callback_example" // String | None
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -313,7 +340,7 @@ Name | Type | Description | Notes
|
||||
**int64** | **Number**| None | [optional]
|
||||
**_float** | **Number**| None | [optional]
|
||||
**_string** | **String**| None | [optional]
|
||||
**binary** | **Blob**| None | [optional]
|
||||
**binary** | **File**| None | [optional]
|
||||
**_date** | **Date**| None | [optional]
|
||||
**dateTime** | **Date**| None | [optional]
|
||||
**password** | **String**| None | [optional]
|
||||
@@ -329,8 +356,8 @@ null (empty response body)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testEnumParameters"></a>
|
||||
# **testEnumParameters**
|
||||
@@ -345,18 +372,16 @@ To test enum parameters
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array)
|
||||
'enumFormString': "-efg", // String | Form parameter enum test (string)
|
||||
'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array)
|
||||
var opts = {
|
||||
'enumHeaderStringArray': ["'$'"], // [String] | Header parameter enum test (string array)
|
||||
'enumHeaderString': "-efg", // String | Header parameter enum test (string)
|
||||
'enumQueryStringArray': ["enumQueryStringArray_example"], // [String] | Query parameter enum test (string array)
|
||||
'enumQueryStringArray': ["'$'"], // [String] | Query parameter enum test (string array)
|
||||
'enumQueryString': "-efg", // String | Query parameter enum test (string)
|
||||
'enumQueryInteger': 56, // Number | Query parameter enum test (double)
|
||||
'enumQueryDouble': 1.2 // Number | Query parameter enum test (double)
|
||||
'enumQueryDouble': 3.4, // Number | Query parameter enum test (double)
|
||||
'enumFormStringArray': null, // [String] | Form parameter enum test (string array)
|
||||
'enumFormString': "enumFormString_example" // String | Form parameter enum test (string)
|
||||
};
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -371,14 +396,14 @@ apiInstance.testEnumParameters(opts, callback);
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional]
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional]
|
||||
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional]
|
||||
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional]
|
||||
**enumFormStringArray** | [**[String]**](Array.md)| Form parameter enum test (string array) | [optional]
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -390,26 +415,21 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: */*
|
||||
- **Accept**: */*
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testInlineAdditionalProperties"></a>
|
||||
# **testInlineAdditionalProperties**
|
||||
> testInlineAdditionalProperties(param)
|
||||
> testInlineAdditionalProperties(requestBody)
|
||||
|
||||
test inline additionalProperties
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var param = null; // Object | request body
|
||||
|
||||
|
||||
var requestBody = {key: "inner_example"}; // String | request body
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -417,14 +437,14 @@ var callback = function(error, data, response) {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
};
|
||||
apiInstance.testInlineAdditionalProperties(param, callback);
|
||||
apiInstance.testInlineAdditionalProperties(requestBody, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **Object**| request body |
|
||||
**requestBody** | [**String**](String.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -445,19 +465,13 @@ No authorization required
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var param = "param_example"; // String | field1
|
||||
|
||||
var param2 = "param2_example"; // String | field2
|
||||
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@@ -485,6 +499,6 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user