Skip to content

Commit 5e76322

Browse files
allow re script with comments
1 parent 71efb3d commit 5e76322

File tree

31 files changed

+4892
-1
lines changed

31 files changed

+4892
-1
lines changed

reverse_engineering/helpers/dataHelper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
const commonHelper = require('./commonHelper');
33
const propertiesConfig = require('../propertiesConfig');
4+
const jsonComment = require('comment-json');
45

56
const REQUEST = 'request';
67
const RESPONSE = 'response';
@@ -868,7 +869,7 @@ const getModelContent = (pathData, fieldOrder, callbacksComponent) => {
868869

869870
const getOpenAPIJsonSchema = (data, fileName, extension) => {
870871
const schema = extension !== '.json' ? commonHelper.convertYamlToJson(data) : data;
871-
const openAPISchema = typeof schema === 'string' ? JSON.parse(schema) : schema;
872+
const openAPISchema = typeof schema === 'string' ? jsonComment.parse(schema.replace(/^#.+$/mg, '')) : schema;
872873
const updatedOpenApiSchema = copyPathItemLevelParametersToOperationObject(openAPISchema);
873874
const openAPISchemaWithModelName = Object.assign({}, updatedOpenApiSchema, {
874875
modelName: fileName

reverse_engineering/node_modules/array-timsort/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reverse_engineering/node_modules/array-timsort/README.md

Lines changed: 288 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)