Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix naming of disableStrictSSL to disableStrictSsl #487

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ interface GenerateApiParamsBase {
/**
* disabled SSL check
*/
disableStrictSSL?: boolean;
disableStrictSsl?: boolean;
/**
* disabled Proxy
*/
Expand Down Expand Up @@ -539,7 +539,7 @@ export interface GenerateApiConfiguration {
moduleNameIndex: number;
moduleNameFirstTag: boolean;
extraTemplates: { name: string; path: string }[];
disableStrictSSL: boolean;
disableStrictSsl: boolean;
disableProxy: boolean;
extractRequestParams: boolean;
unwrapResponseData: boolean;
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const program = cli({
{
flags: "--disableStrictSSL",
description: "disabled strict SSL",
default: codeGenBaseConfig.disableStrictSSL,
default: codeGenBaseConfig.disableStrictSsl,
internal: { formatter: Boolean },
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CodeGenConfig {

/** use the first tag for the module name */
moduleNameFirstTag = false;
disableStrictSSL = false;
disableStrictSsl = false;
disableProxy = false;
extractRequestParams = false;
extractRequestBody = false;
Expand Down
8 changes: 4 additions & 4 deletions src/swagger-schema-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SwaggerSchemaResolver {
* @returns {Promise<{usageSchema: Record<string, *>, originalSchema: Record<string, *>}>}
*/
async create() {
const { spec, patch, input, url, disableStrictSSL, disableProxy, authorizationToken } = this.config;
const { spec, patch, input, url, disableStrictSsl, disableProxy, authorizationToken } = this.config;

if (this.config.spec) {
return await this.convertSwaggerObject(spec, { patch });
Expand All @@ -42,7 +42,7 @@ class SwaggerSchemaResolver {
const swaggerSchemaFile = await this.fetchSwaggerSchemaFile(
input,
url,
disableStrictSSL,
disableStrictSsl,
disableProxy,
authorizationToken,
);
Expand Down Expand Up @@ -104,14 +104,14 @@ class SwaggerSchemaResolver {
return this.fileSystem.getFileContent(pathToSwagger);
};

async fetchSwaggerSchemaFile(pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy, authToken) {
async fetchSwaggerSchemaFile(pathToSwagger, urlToSwagger, disableStrictSsl, disableProxy, authToken) {
if (this.fileSystem.pathIsExist(pathToSwagger)) {
return this.getSwaggerSchemaByPath(pathToSwagger);
} else {
this.logger.log(`try to get swagger by URL "${urlToSwagger}"`);
return await this.request.download({
url: urlToSwagger,
disableStrictSSL,
disableStrictSsl,
authToken,
disableProxy,
});
Expand Down
6 changes: 3 additions & 3 deletions src/util/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ class Request {
/**
*
* @param url {string}
* @param disableStrictSSL
* @param disableStrictSsl
* @param authToken
* @param options {Partial<import("node-fetch").RequestInit>}
* @return {Promise<string>}
*/
async download({ url, disableStrictSSL, authToken, ...options }) {
async download({ url, disableStrictSsl, authToken, ...options }) {
/**
* @type {Partial<import("node-fetch").RequestInit>}
*/
const requestOptions = {};

if (disableStrictSSL && !_.startsWith(url, "http://")) {
if (disableStrictSsl && !_.startsWith(url, "http://")) {
requestOptions.agent = new https.Agent({
rejectUnauthorized: false,
});
Expand Down