-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add multiple file support #6
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
Conversation
Closes #2 BREAKING CHANGE: `pathToSpec` renamed to `pathsToSpec` and it is `string[]` now instead of `string`
@raveclassic, please review this PR |
package.json
Outdated
@@ -6,7 +6,7 @@ | |||
"scripts": { | |||
"ts-node": "ts-node", | |||
"tslint": "tslint -c tslint.json --project tsconfig.json './src/**/*.ts' './test/**/*.ts'", | |||
"test": "npm run tslint && npm run prettier && ts-node ./test/index.ts", | |||
"test": "rm -rf ./test/out && npm run tslint && npm run prettier && ts-node ./test/index.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't work in cmd
. You can add rimraf
to dependencies and use it as cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i used del
src/index.ts
Outdated
}; | ||
}; | ||
|
||
const decode = (json: TJSON): Either<ValidationError[], TSwaggerObject> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/index.ts
Outdated
fileName: string; | ||
}; | ||
|
||
const read = async (_pathToFile: string): Promise<TBuffer> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use _naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/language/typescript.ts
Outdated
@@ -218,10 +220,29 @@ const serializePath = (url: string, item: TPathItemObject, rootName: string, cwd | |||
const serializeSchemaObject = (schema: TSchemaObject, rootName: string, cwd: string): TSerializedType => { | |||
switch (schema.type) { | |||
case undefined: { | |||
const type = `${schema.$ref.replace(/^#\/definitions\//g, '')}`; | |||
const $ref = schema.$ref; | |||
const defBlock = fromNullable($ref.match(/#\/[^\/]+\//)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you trying to achieve here? I believe everything can be rewritten with a single match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with a single match
@@ -0,0 +1,182 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default identation for json files is 2 spaces. See .editorconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is nothing about json
in the .editorconfig
but i changed it to 2 spaces
review fixes
Closes #2
BREAKING CHANGE:
pathToSpec
renamed topathsToSpec
and it isstring[]
now instead ofstring