Closed Kanna727 closed 4 years ago
I've gone through your code. Surprisingly in following files on git, there is defaults.sample = true
line:
https://github.com/Mermade/widdershins/blob/a173d54046ca608aac5403a2dd9a94f389fd5996/lib/openapi3.js#L618 https://github.com/Mermade/widdershins/blob/a173d54046ca608aac5403a2dd9a94f389fd5996/lib/asyncapi1.js#L140 https://github.com/Mermade/widdershins/blob/a173d54046ca608aac5403a2dd9a94f389fd5996/lib/semoasa.js#L29
But I couldn't find any of these lines when installed via npm. Please find the below files which are directly from this package's folder in node_modules
:
openapi3.js asyncapi1.js semoasa.js
I've installed latest version 4.0.1 via npm: npm install widdershins --save-dev
Please confirm if I've installed your package wrong
Looks like PR #329 with following commit https://github.com/Mermade/widdershins/commit/588c1d3ae42da26980ed1274e3a33f8b3447fac5 has already resolved this but the fix has not been released yet. It has already been more than 4 months since the fix. Kindly trigger a release, so that people like us won't have to spend soo much time on resolved issues like this.
Please watch:releases for the next release or install from GitHub if you need unreleased fixes/features.
Describe the bug When running via CLI, if some default options are set, why aren't same defaults set when running via Node? Why should we worry about writing defaults manually? This will also be a problem when we are migrating from CLI to Node and poduces undesired outputs.
Following is my config file while running via CLI:
And following is the options variable when running via node:
I'm parsing the same OpenAPI 3.0 JSON file as input in both the cases. So I'm expecting the same output from both the methods. Instead the requestBody example are varying as follows:
requestBody example when running via CLI:
requestBody example when running via node:
I've checked your code flow and found out the final options variable are actually different for both the methods at following line: https://github.com/Mermade/widdershins/blob/07831f6d7a97b47cf3968a094458e43b9c8e6701/lib/index.js#L9
When running via CLI:
When running via Node:
To Reproduce Steps to reproduce the behavior:
widdershins ./docs/oas3sample.json -o ./docs/api-docs-cli.md -e ./config/conf.json
Expected behavior Defaults should be same across CLI & Node