Skip to content

Commit

Permalink
HCK-7065: fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii-filonenko committed Jul 11, 2024
1 parent dbf4022 commit 5610930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reverse_engineering/helpers/commonHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const reorderFields = (data, filedOrder) => {

const sortObject = obj => {
return Object.keys(obj || {})
.sort()
.sort((a, b) => a?.localeCompare(b))
.reduce((acc, key) => {
if (CHOICES.includes(key)) {
acc[key] = obj[key];
Expand Down
11 changes: 6 additions & 5 deletions reverse_engineering/helpers/dataHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,13 +706,14 @@ const handleParameter = (parameter, parameterName, fieldOrder) => {
};

const parameterSchemaObject = getSchemaObject(parameter, fieldOrder);
const parameterContent = getContentObject(parameter, fieldOrder);
const parameterExamples = getExamplesObject(parameter, fieldOrder);
const parameterContent = getContentObject(parameter);
const parameterExamples = getExamplesObject(parameter);
const parameterType = getParameterType(parameter);
const parameterProperties = Object.assign({}, parameterSchemaObject.properties || {}, {
const parameterProperties = {
...(parameterSchemaObject.properties || {}),
content: parameterContent,
examples: parameterExamples,
});
};
const newParameter = Object.assign({}, parameterSchemaObject, parameter, {
name: parameterName || parameter.name,
parameterName: parameter.name,
Expand Down Expand Up @@ -827,7 +828,7 @@ const getEntities = (pathData, containers, fieldOrder) => {
const entitiesNames = Object.keys(containerData).filter(item => REQUEST_TYPE.includes(item));
const entities = entitiesNames.reduce((accumulator, request) => {
const requestData = containerData[request];
const { jsonSchema, responses } = handleRequestData(requestData, request, container.name, fieldOrder);
const { jsonSchema, responses } = handleRequestData(requestData, request, fieldOrder);
const responseSchemas = Object.keys(responses || {}).map(response => {
return handleResponseData(responses[response], response, request, fieldOrder);
});
Expand Down

0 comments on commit 5610930

Please sign in to comment.