async function sortParameters(paths) {
    let exceptionParameters = ['user', 'username', 'pass', 'password'];
    try {
        if (globalOptions.sortParameters.toLowerCase() == 'alphabetically') {
            let pathList = Object.entries(paths);
            for (let idxPath = 0; idxPath < Object.entries(paths).length; ++idxPath) {
                let path = pathList[idxPath][0];
                let methods = Object.entries(pathList[idxPath][1]);
                for (let idx = 0; idx < methods.length; ++idx) {
                    let method = methods[idx][0];
                    let parameters = methods[idx][1].parameters;
                    if (parameters && parameters.length > 0) {
                        let sortedParameters = parameters.sort((a, b) => sortAlphabetically(a, b));
                        sortedParameters = sortedParameters.sort((a, b) => sortByRequestType(a, b));
                        sortedParameters = sortedParameters.sort((a, b) => sortByPathParameter(a, b));

                        // Sorting the body (Swagger2). TODO: OpenAPIv3
                        for (let idxBody = 0; idxBody < sortedParameters.length; ++idxBody) {
                            let param = sortedParameters[idxBody];
                            if (param && param.schema && param.schema.properties) {
                                let sortedProperties = sortObjectKeyAlphabetically(param.schema.properties);
                                let bodyParameters = Object.keys(sortedProperties);
                                if (bodyParameters.length == 2 && param.schema.properties) {
                                    // Sort exception for user/username and pass/password
                                    if (exceptionParameters.slice(2, 4).includes(bodyParameters[0].toLocaleLowerCase()) && exceptionParameters.slice(0, 2).includes(bodyParameters[1].toLocaleLowerCase())) {
                                        sortedParameters[idxBody].schema.properties = {};
                                        sortedParameters[idxBody].schema.properties[bodyParameters[1]] = sortedProperties[bodyParameters[1]];
                                        sortedParameters[idxBody].schema.properties[bodyParameters[0]] = sortedProperties[bodyParameters[0]];
                                        break;
                                    }
                                }
                                sortedParameters[idxBody].schema.properties = sortedProperties;
                            }
                        }

                        paths[path][method].parameters = sortedParameters;
                    }
                }
            }
        }
        return paths;
    } catch (err) {
        return paths;
    }
}
Sort parameters. (in test)
@param {Array} parameters