forked from loafle/openapi-generator-original
Fix template directory used by samples script. (#5284)
This commit is contained in:
parent
ffb4d52469
commit
8bd67c9f7f
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/typescript-fetch -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-fetch -o samples/client/petstore-security-test/typescript-fetch"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/TypeScript-Fetch -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-fetch -o samples/client/petstore-security-test/typescript-fetch"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -51,7 +51,7 @@ export interface ModelReturn {
|
||||
/**
|
||||
* FakeApi - fetch parameter creator
|
||||
*/
|
||||
export const FakeApiFetchParamCreactor = {
|
||||
export const FakeApiFetchParamCreator = {
|
||||
/**
|
||||
* 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
|
||||
@ -61,9 +61,9 @@ export const FakeApiFetchParamCreactor = {
|
||||
let urlObj = url.parse(baseUrl, true);
|
||||
let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options);
|
||||
|
||||
let contentTypeHeader: Dictionary<string>;
|
||||
let contentTypeHeader: Dictionary<string> = {};
|
||||
contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" };
|
||||
fetchOptions.body = querystring.stringify({
|
||||
fetchOptions.body = querystring.stringify({
|
||||
"test code inject */ ' " =end -- \r\n \n \r": params["test code inject * ' " =end rn n r"],
|
||||
});
|
||||
if (contentTypeHeader) {
|
||||
@ -84,8 +84,8 @@ export const FakeApiFp = {
|
||||
* 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
|
||||
*/
|
||||
testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
|
||||
const fetchArgs = FakeApiFetchParamCreactor.testCodeInjectEndRnNR(params, options);
|
||||
testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<any> {
|
||||
const fetchArgs = FakeApiFetchParamCreator.testCodeInjectEndRnNR(params, options);
|
||||
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
|
||||
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
|
||||
if (response.status >= 200 && response.status < 300) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user