Merge branch 'master' into user/shawkins/fix/dont_modify_parameter_names

This commit is contained in:
Spencer Hawkins 2016-05-20 12:32:19 -07:00
commit 5dcda94164
71 changed files with 622 additions and 214 deletions

2
.gitignore vendored
View File

@ -117,6 +117,8 @@ samples/client/petstore/python/.venv/
# ts
samples/client/petstore/typescript-node/npm/node_modules
samples/client/petstore/typescript-node/**/typings
samples/client/petstore/typescript-angular/**/typings
samples/client/petstore/typescript-fetch/**/dist/
samples/client/petstore/typescript-fetch/**/typings

View File

@ -10,6 +10,7 @@ services:
before_install:
# required when sudo: required for the Ruby petstore tests
- gem install bundler
- npm install -g typescript
install:

View File

@ -146,6 +146,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
supportingFiles.add(new SupportingFile("api_client.mustache", "", "api_client.go"));
supportingFiles.add(new SupportingFile("api_response.mustache", "", "api_response.go"));
supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
}

View File

@ -78,12 +78,12 @@ public class {{classname}} {
{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
final String[] {{localVariablePrefix}}localVarContentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);

View File

@ -75,8 +75,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}

View File

@ -76,12 +76,12 @@ public class {{classname}} {
{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
final String[] {{localVariablePrefix}}localVarContentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);

View File

@ -76,13 +76,13 @@ public class {{classname}} {
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept);
final String[] {{localVariablePrefix}}localVarContentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
{{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType);

View File

@ -18,8 +18,8 @@ public interface {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}});
{{/operation}}
}

View File

@ -25,8 +25,8 @@ import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
@Path("/{{baseName}}")
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.Api(description = "the {{baseName}} API")
{{>generatedAnnotation}}
{{#operations}}
@ -36,8 +36,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},

View File

@ -23,8 +23,8 @@ import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
@Path("/{{baseName}}")
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.Api(description = "the {{baseName}} API")
{{>generatedAnnotation}}
{{#operations}}
@ -34,8 +34,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},

View File

@ -19,8 +19,8 @@ import javax.ws.rs.*;
{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
{{/isMultipart}}{{/operation}}{{/operations}}
@Path("/{{baseName}}")
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{>generatedAnnotation}}
{{#operations}}
public class {{classname}} {
@ -29,8 +29,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.{{nickname}}({{#isMultipart}}input,{{/isMultipart}}{{#allParams}}{{^isMultipart}}{{paramName}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}}{{paramName}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}securityContext);

View File

@ -41,8 +41,8 @@ public class {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{{path}}}",
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
{{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})

View File

@ -49,8 +49,8 @@ public interface {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{path}}",
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
{{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
default Callable<ResponseEntity<{{>returnTypes}}>> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})

View File

@ -46,8 +46,8 @@ public class {{classname}} {
@io.swagger.annotations.ApiResponses(value = { {{#responses}}
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{{path}}}",
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
{{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})

View File

@ -82,8 +82,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}

View File

@ -20,7 +20,7 @@ object {{classname}} {
{{>javadoc}}
{{/javadocRenderer}}
def {{operationId}}({{>methodParameters}}): ApiRequest[{{>operationReturnType}}] =
ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{path}}", {{#consumes.0}}"{{mediaType}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}})
ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{path}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}})
{{#authMethods}}{{#isApiKey}}.withApiKey(apiKey, "{{keyParamName}}", {{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}})
{{/isApiKey}}{{#isBasic}}.withCredentials(basicAuth)
{{/isBasic}}{{/authMethods}}{{#bodyParam}}.withBody({{paramName}})

View File

@ -73,7 +73,7 @@ public class {{classname}} {
{{/headerParams}}
String[] localVarContentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";

View File

@ -53,8 +53,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}

View File

@ -81,7 +81,7 @@ public class {{classname}} {
{{/headerParams}}
String[] contentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
@ -167,7 +167,7 @@ public class {{classname}} {
{{/headerParams}}
String[] contentTypes = {
{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

View File

@ -196,7 +196,7 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
@ -204,7 +204,7 @@ namespace {{packageName}}.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
@ -329,7 +329,7 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
@ -337,7 +337,7 @@ namespace {{packageName}}.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

View File

@ -87,8 +87,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -37,7 +37,7 @@ class {{classname}} {
{{#headerParams}}headerParams["{{baseName}}"] = {{paramName}};
{{/headerParams}}
List<String> contentTypes = [{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}];
List<String> contentTypes = [{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = [{{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];

View File

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

View File

@ -95,7 +95,7 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
{{/queryParams}}{{/hasQueryParams}}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ {{#consumes}}"{{mediaType}}", {{/consumes}} }
localVarHttpContentTypes := []string{ {{#consumes}}"{{{mediaType}}}", {{/consumes}} }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
@ -104,7 +104,7 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
{{#produces}}"{{mediaType}}",
{{#produces}}"{{{mediaType}}}",
{{/produces}} }
// set Accept header

View File

@ -35,8 +35,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -61,7 +61,7 @@
This API call consumes the following media types via the <span class="heaader">Content-Type</span> request header:
<ul>
{{#consumes}}
<li><code>{{mediaType}}</code></li>
<li><code>{{{mediaType}}}</code></li>
{{/consumes}}
</ul>
{{/hasConsumes}}
@ -118,7 +118,7 @@
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
{{#produces}}
<li><code>{{mediaType}}</code></li>
<li><code>{{{mediaType}}}</code></li>
{{/produces}}
</ul>
{{/hasProduces}}

View File

@ -13,7 +13,7 @@ $app->get('/', function () use ($app) {
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
$app->{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}$null = null) use ($app) {
{{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}}

View File

@ -13,7 +13,7 @@ $app->get('/', function () use ($app) {
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
Route::{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}null) use ($app) {
{{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}}

View File

@ -126,7 +126,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
}
{{/headerParams}}
// HTTP header `Accept`
NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[{{#produces}}@"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
if(acceptHeader.length > 0) {
headerParams[@"Accept"] = acceptHeader;
}
@ -135,7 +135,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[{{#consumes}}@"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
// Authentication setting
NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];

View File

@ -76,8 +76,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -100,11 +100,11 @@ sub {{operationId}} {
my $form_params = {};
# 'Accept' and 'Content-Type' header
my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}});
my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}});
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}});
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}});
{{#queryParams}}
# query params

View File

@ -67,8 +67,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -167,11 +167,11 @@ use \{{invokerPackage}}\ObjectSerializer;
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
$_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
{{#queryParams}}// query params
{{#collectionFormat}}

View File

@ -63,8 +63,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -156,13 +156,13 @@ class {{classname}}(object):
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept([{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
# Authentication setting
auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]

View File

@ -65,8 +65,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)

View File

@ -98,11 +98,11 @@ module {{moduleName}}
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
local_header_accept = [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
local_header_content_type = [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type){{#headerParams}}{{#required}}
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}}
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}}

View File

@ -70,8 +70,8 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}

View File

@ -36,7 +36,7 @@ class {{classname}}(val defBasePath: String = "{{basePath}}",
{{/pathParams}}
val contentTypes = List({{#consumes}}"{{mediaType}}", {{/consumes}}"application/json")
val contentTypes = List({{#consumes}}"{{{mediaType}}}", {{/consumes}}"application/json")
val contentType = contentTypes(0)
// query params

View File

@ -13,7 +13,7 @@ $app = new Slim\App();
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
$app->{{httpMethod}}('{{path}}', function($request, $response, $args) {
{{#hasHeaderParams}}$headers = $request->getHeaders();{{/hasHeaderParams}}

View File

@ -2,12 +2,14 @@
"name": "{{npmName}}",
"version": "{{npmVersion}}",
"description": "NodeJS client for {{npmName}}",
"repository": "{{gitUserId}}/{{gitRepoId}}",
"main": "api.js",
"scripts": {
"clean": "rm -Rf node_modules/ typings/ *.js",
"build": "typings install && tsc"
},
"author": "Swagger Codegen Contributors",
"license": "MIT",
"license": "Apache-2.0",
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0"

View File

@ -575,9 +575,12 @@ paths:
偽のエンドポイント
가짜 엔드 포인트
operationId: testEndpointParameters
consumes:
- application/xml; charset=utf-8
- application/json; charset=utf-8
produces:
- application/xml
- application/json
- application/xml; charset=utf-8
- application/json; charset=utf-8
parameters:
- name: integer
type: integer

82
pom.xml
View File

@ -438,6 +438,78 @@
<module>samples/server/petstore/jaxrs</module>
</modules>
</profile>
<profile>
<id>typescript-fetch-client-tests-default</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-fetch/tests/default</module>
</modules>
</profile>
<profile>
<id>typescript-fetch-client-builds-default</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-fetch/builds/default</module>
</modules>
</profile>
<profile>
<id>typescript-fetch-client-builds-es6-target</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
</modules>
</profile>
<profile>
<id>typescript-fetch-client-builds-with-npm-version</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
</modules>
</profile>
<profile>
<id>typescript-angular-client</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-angular/npm</module>
</modules>
</profile>
<profile>
<id>typescript-node-npm-client</id>
<activation>
<property>
<name>env</name>
<value>java</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/typescript-node/npm</module>
</modules>
</profile>
<profile>
<id>ruby-client</id>
<activation>
@ -471,6 +543,15 @@
</property>
</activation>
<modules>
<!--<module>samples/client/petstore/typescript-fetch/tests/default</module>
<module>samples/client/petstore/typescript-fetch/builds/default</module>
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>-->
<!-- run ruby test first which has a random delay script to
avoid issues with running 2 CI jobs in parallel. -->
<module>samples/client/petstore/ruby</module>
<module>samples/client/petstore/typescript-angular</module>
<module>samples/client/petstore/typescript-node/npm</module>
<module>samples/client/petstore/android/volley</module>
<module>samples/client/petstore/clojure</module>
<module>samples/client/petstore/java/default</module>
@ -483,7 +564,6 @@
<module>samples/client/petstore/javascript</module>
<module>samples/client/petstore/scala</module>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/client/petstore/ruby</module>
<module>samples/server/petstore/jaxrs</module>
<module>samples/server/petstore/jaxrs-resteasy</module>
<!--module>samples/client/petstore/objc/SwaggerClientTests</module-->

View File

@ -1,79 +0,0 @@
# Go API client for swagger
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
## 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
- Package version: 1.0.0
- Build date: 2016-04-16T15:44:50.329-07:00
- Build package: class io.swagger.codegen.languages.GoClientCodegen
## Installation
Put the package under your project folder and add the following in import:
```
"./swagger"
```
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user
## Documentation For Models
- [ApiResponse](docs/ApiResponse.md)
- [Category](docs/Category.md)
- [Order](docs/Order.md)
- [Pet](docs/Pet.md)
- [Tag](docs/Tag.md)
- [User](docs/User.md)
## Documentation For Authorization
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## Author
apiteam@swagger.io

View File

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

View File

@ -1,12 +0,0 @@
# ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **int32** | | [optional] [default to null]
**Type_** | **string** | | [optional] [default to null]
**Message** | **string** | | [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)

View File

@ -72,4 +72,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0
- Package version:
- Build date: 2016-05-14T13:02:51.476+02:00
- Build date: 2016-05-20T17:45:19.363+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@ -112,6 +112,7 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md)
- [Animal](docs/Model/Animal.md)
- [AnimalFarm](docs/Model/AnimalFarm.md)
- [ApiResponse](docs/Model/ApiResponse.md)
@ -121,6 +122,7 @@ Class | Method | HTTP request | Description
- [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/Model/EnumTest.md)
- [FormatTest](docs/Model/FormatTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model/Model200Response.md)
- [ModelReturn](docs/Model/ModelReturn.md)
- [Name](docs/Model/Name.md)
@ -134,6 +136,12 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## petstore_auth
- **Type**: OAuth
@ -143,12 +151,6 @@ Class | Method | HTTP request | Description
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## Author

View File

@ -68,8 +68,8 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
[[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)

View File

@ -216,11 +216,11 @@ class FakeApi
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml; charset=utf-8', 'application/json; charset=utf-8'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/xml; charset=utf-8','application/json; charset=utf-8'));

View File

@ -256,7 +256,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') {

View File

@ -1,6 +1,7 @@
{
"name": "petstore-typescript-node-sample",
"version": "1.0.0",
"repository": "GIT_USER_ID/GIT_REPO_ID",
"description": "Sample of generated TypeScript petstore client",
"main": "api.js",
"scripts": {
@ -8,8 +9,8 @@
"test": "tsc --target ES6 && node client.js",
"clean": "rm -Rf node_modules/ typings/ *.js"
},
"author": "Mads M. Tandrup",
"license": "Apache 2.0",
"author": "Swagger Codegen Contributors & Mads M. Tandrup",
"license": "Apache-2.0",
"dependencies": {
"request": "^2.60.0",
"angular": "^1.4.3"

View File

@ -0,0 +1,59 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptAngularPestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Angular Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Angular Build Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptAngularBuildES6PestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Angular Build ES6 Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptAngularBuildWithNPMVersionPestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Angular Build With NPM Version Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -13,6 +13,7 @@
},
"scripts": {
"prepublish": "./scripts/prepublish.sh",
"pretest": "npm install mocha",
"test": "mocha"
},
"name": "typescript-fetch-test",

View File

@ -0,0 +1,59 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptFetchPestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Fetch default Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,2 @@
tsconfig.json
package.json

View File

@ -80,8 +80,8 @@ export declare class PetApi {
protected defaultHeaders: any;
protected authentications: {
'default': Authentication;
'api_key': ApiKeyAuth;
'petstore_auth': OAuth;
'api_key': ApiKeyAuth;
};
constructor(basePath?: string);
setApiKey(key: PetApiApiKeys, value: string): void;
@ -128,8 +128,8 @@ export declare class StoreApi {
protected defaultHeaders: any;
protected authentications: {
'default': Authentication;
'api_key': ApiKeyAuth;
'petstore_auth': OAuth;
'api_key': ApiKeyAuth;
};
constructor(basePath?: string);
setApiKey(key: StoreApiApiKeys, value: string): void;
@ -162,8 +162,8 @@ export declare class UserApi {
protected defaultHeaders: any;
protected authentications: {
'default': Authentication;
'api_key': ApiKeyAuth;
'petstore_auth': OAuth;
'api_key': ApiKeyAuth;
};
constructor(basePath?: string);
setApiKey(key: UserApiApiKeys, value: string): void;

View File

@ -1,3 +1,4 @@
"use strict";
var request = require('request');
var promise = require('bluebird');
var defaultBasePath = 'http://petstore.swagger.io/v2';
@ -5,13 +6,13 @@ var Category = (function () {
function Category() {
}
return Category;
})();
}());
exports.Category = Category;
var Order = (function () {
function Order() {
}
return Order;
})();
}());
exports.Order = Order;
var Order;
(function (Order) {
@ -26,7 +27,7 @@ var Pet = (function () {
function Pet() {
}
return Pet;
})();
}());
exports.Pet = Pet;
var Pet;
(function (Pet) {
@ -41,13 +42,13 @@ var Tag = (function () {
function Tag() {
}
return Tag;
})();
}());
exports.Tag = Tag;
var User = (function () {
function User() {
}
return User;
})();
}());
exports.User = User;
var HttpBasicAuth = (function () {
function HttpBasicAuth() {
@ -58,7 +59,7 @@ var HttpBasicAuth = (function () {
};
};
return HttpBasicAuth;
})();
}());
exports.HttpBasicAuth = HttpBasicAuth;
var ApiKeyAuth = (function () {
function ApiKeyAuth(location, paramName) {
@ -74,7 +75,7 @@ var ApiKeyAuth = (function () {
}
};
return ApiKeyAuth;
})();
}());
exports.ApiKeyAuth = ApiKeyAuth;
var OAuth = (function () {
function OAuth() {
@ -83,7 +84,7 @@ var OAuth = (function () {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
};
return OAuth;
})();
}());
exports.OAuth = OAuth;
var VoidAuth = (function () {
function VoidAuth() {
@ -91,7 +92,7 @@ var VoidAuth = (function () {
VoidAuth.prototype.applyToRequest = function (requestOptions) {
};
return VoidAuth;
})();
}());
exports.VoidAuth = VoidAuth;
(function (PetApiApiKeys) {
PetApiApiKeys[PetApiApiKeys["api_key"] = 0] = "api_key";
@ -103,8 +104,8 @@ var PetApi = (function () {
this.defaultHeaders = {};
this.authentications = {
'default': new VoidAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
};
if (password) {
if (basePath) {
@ -321,8 +322,8 @@ var PetApi = (function () {
uri: localVarPath,
json: true,
};
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
if (Object.keys(formParams).length) {
if (useFormData) {
@ -487,7 +488,7 @@ var PetApi = (function () {
return localVarDeferred.promise;
};
return PetApi;
})();
}());
exports.PetApi = PetApi;
(function (StoreApiApiKeys) {
StoreApiApiKeys[StoreApiApiKeys["api_key"] = 0] = "api_key";
@ -499,8 +500,8 @@ var StoreApi = (function () {
this.defaultHeaders = {};
this.authentications = {
'default': new VoidAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
};
if (password) {
if (basePath) {
@ -694,7 +695,7 @@ var StoreApi = (function () {
return localVarDeferred.promise;
};
return StoreApi;
})();
}());
exports.StoreApi = StoreApi;
(function (UserApiApiKeys) {
UserApiApiKeys[UserApiApiKeys["api_key"] = 0] = "api_key";
@ -706,8 +707,8 @@ var UserApi = (function () {
this.defaultHeaders = {};
this.authentications = {
'default': new VoidAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
};
if (password) {
if (basePath) {
@ -1065,6 +1066,6 @@ var UserApi = (function () {
return localVarDeferred.promise;
};
return UserApi;
})();
}());
exports.UserApi = UserApi;
//# sourceMappingURL=api.js.map

File diff suppressed because one or more lines are too long

View File

@ -131,8 +131,8 @@ export class PetApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -398,10 +398,10 @@ export class PetApi {
json: true,
};
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
if (Object.keys(formParams).length) {
@ -610,8 +610,8 @@ export class StoreApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -847,8 +847,8 @@ export class UserApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);

View File

@ -0,0 +1,53 @@
"use strict";
var api = require('./api');
var fs = require('fs');
var petApi = new api.PetApi();
petApi.setApiKey(api.PetApiApiKeys.api_key, 'special-key');
var tag1 = new api.Tag();
tag1.id = 18291;
tag1.name = 'TS tag 1';
var pet = new api.Pet();
pet.name = 'TypeScriptDoggie';
pet.id = 18291;
pet.photoUrls = ["http://url1", "http://url2"];
pet.tags = [tag1];
var petId;
var exitCode = 0;
petApi.addPet(pet)
.then(function (res) {
var newPet = res.body;
petId = newPet.id;
console.log("Created pet with ID " + petId);
newPet.status = api.Pet.StatusEnum.StatusEnum_available;
return petApi.updatePet(newPet);
})
.then(function (res) {
console.log('Updated pet using POST body');
return petApi.updatePetWithForm(petId, undefined, "pending");
})
.then(function (res) {
console.log('Updated pet using POST form');
return petApi.uploadFile(petId, undefined, fs.createReadStream('sample.png'));
})
.then(function (res) {
console.log('Uploaded image');
return petApi.getPetById(petId);
})
.then(function (res) {
console.log('Got pet by ID: ' + JSON.stringify(res.body));
if (res.body.status != api.Pet.StatusEnum.StatusEnum_pending) {
throw new Error("Unexpected pet status");
}
})
.catch(function (err) {
console.error(err);
exitCode = 1;
})
.finally(function () {
return petApi.deletePet(petId);
})
.then(function (res) {
console.log('Deleted pet');
process.exit(exitCode);
});
//# sourceMappingURL=client.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":";AAAA,IAAO,GAAG,WAAW,OAAO,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAE1B,IAAI,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;AAC9B,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAG3D,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACzB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;AAChB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;AAEvB,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACxB,GAAG,CAAC,IAAI,GAAG,kBAAkB,CAAC;AAC9B,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;AACf,GAAG,CAAC,SAAS,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAC/C,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;AAElB,IAAI,KAAU,CAAC;AAEf,IAAI,QAAQ,GAAG,CAAC,CAAC;AAGjB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;KACb,IAAI,CAAC,UAAC,GAAG;IACN,IAAI,MAAM,GAAY,GAAG,CAAC,IAAI,CAAC;IAC/B,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,yBAAuB,KAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC;IACxD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;KACD,IAAI,CAAC,UAAC,GAAG;IACN,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACjE,CAAC,CAAC;KACD,IAAI,CAAC,UAAC,GAAG;IACN,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC;KACD,IAAI,CAAC,UAAC,GAAG;IACN,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9B,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;KACD,IAAI,CAAC,UAAC,GAAG;IACN,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC,CAAC;KACD,KAAK,CAAC,UAAC,GAAQ;IACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,GAAG,CAAC,CAAC;AACjB,CAAC,CAAC;KACD,OAAO,CAAC;IACL,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;KACD,IAAI,CAAC,UAAC,GAAG;IACN,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC"}

View File

@ -3,7 +3,7 @@ import fs = require('fs');
var petApi = new api.PetApi();
petApi.setApiKey(api.PetApiApiKeys.api_key, 'special-key');
petApi.setApiKey(api.PetApiApiKeys.test_api_key_header, 'query-key');
//petApi.setApiKey(api.PetApiApiKeys.test_api_key_header, 'query-key');
var tag1 = new api.Tag();
tag1.id = 18291;
@ -25,7 +25,7 @@ petApi.addPet(pet)
var newPet = <api.Pet>res.body;
petId = newPet.id;
console.log(`Created pet with ID ${petId}`);
newPet.status = api.Pet.StatusEnum.available;
newPet.status = api.Pet.StatusEnum.StatusEnum_available;
return petApi.updatePet(newPet);
})
.then((res) => {
@ -42,7 +42,7 @@ petApi.addPet(pet)
})
.then((res) => {
console.log('Got pet by ID: ' + JSON.stringify(res.body));
if (res.body.status != api.Pet.StatusEnum.pending) {
if (res.body.status != api.Pet.StatusEnum.StatusEnum_pending) {
throw new Error("Unexpected pet status");
}
})

View File

@ -1,13 +1,16 @@
{
"name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1-SNAPSHOT.201605031634",
"version": "0.0.1-SNAPSHOT.201605191812",
"description": "NodeJS client for @swagger/angular2-typescript-petstore",
"repository": "GIT_USER_ID/GIT_REPO_ID",
"main": "api.js",
"scripts": {
"build": "typings install && tsc"
"clean": "rm -Rf node_modules/ typings/ *.js",
"build": "typings install && tsc",
"test": "tsc && node client.js"
},
"author": "Swagger Codegen Contributors",
"license": "MIT",
"license": "Apache-2.0",
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0"

View File

@ -0,0 +1,73 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>TypeScriptNodeNPMPestoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>TS Node npm Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-build</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

View File

@ -12,6 +12,7 @@
},
"files": [
"api.ts",
"client.ts",
"typings/main.d.ts"
]
}