forked from loafle/openapi-generator-original
Update security samples for typescript-clients (Angular1/2). (#5288)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import * as api from './api/api';
|
||||
import * as angular from 'angular';
|
||||
|
||||
const apiModule = angular.module('api', [])
|
||||
.service('FakeApi', api.FakeApi)
|
||||
|
||||
export default apiModule;
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import * as models from '../model/models';
|
||||
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
export class FakeApi {
|
||||
protected basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||
public defaultHeaders : any = {};
|
||||
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer', 'basePath'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
public testCodeInjectEndRnNR (test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||
const localVarPath = this.basePath + '/fake';
|
||||
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
|
||||
let formParams: any = {};
|
||||
|
||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
formParams['test code inject */ ' " =end -- \r\n \n \r'] = test code inject * ' " =end rn n r;
|
||||
|
||||
let httpRequestParams: ng.IRequestConfig = {
|
||||
method: 'PUT',
|
||||
url: localVarPath,
|
||||
data: this.$httpParamSerializer(formParams),
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
|
||||
if (extraHttpRequestParams) {
|
||||
httpRequestParams = (<any>Object).assign(httpRequestParams, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.$http(httpRequestParams);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './FakeApi';
|
||||
import { FakeApi } from './FakeApi';
|
||||
export const APIS = [ FakeApi, ];
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './api/api';
|
||||
export * from './model/models';
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
||||
/**
|
||||
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
export interface ModelReturn {
|
||||
/**
|
||||
* property description *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
"return"?: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './ModelReturn';
|
||||
@@ -63,7 +63,7 @@ export class FakeApi {
|
||||
* @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
public testCodeInjectEndRnNRWithHttpInfo(test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any): Observable<Response> {
|
||||
const path = this.basePath + `/fake`;
|
||||
const path = this.basePath + '/fake';
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './FakeApi';
|
||||
import { FakeApi } from './FakeApi';
|
||||
export const APIS = [ FakeApi, ];
|
||||
import { FakeApi } from './FakeApi';
|
||||
export const APIS = [FakeApi];
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
||||
/**
|
||||
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
export interface ModelReturn {
|
||||
/**
|
||||
* property description *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*/
|
||||
return?: number;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user