Closed bramdevries closed 5 years ago
Thanks for catching this. I'll add test cases for mentioned issues in the upcoming days.
I fixed the issue and added an integration test in https://github.com/wework/speccy/pull/277
Just a note: my pending MR #270 also solves this issue in a more general way (there's no need to return from a promise, only resolve/reject, and having a single branch exit for each condition makes the code more readable). There were other issues with that part of the code also affecting the stdin support.
The tests added in #277 are very nice though :-)
In fact this is clearly a bug, if an error occurs writing the file, it will reject()
IFF the verbose flag is active:
if (err && verbose) {
console.error('Failed to write file: ' + err.message);
return reject();
}
I'm also running into this issue. Any update on it?
@mdi The PR #270 merged yesterday should solve this. Please check the latest master.
Is it fixed for speccy@0.9?
This is available in master. We'll be cutting a release soon.
@djtarazona I'd also ask you to take a look at #294 before cutting a release, since it is also related to fixing configuration options setup. Thanks!
This is currently blocking my workflow. We have a very large API and want to go with multiple files, but the output is blank. We are migrating from apidoc to Open API 3 and found speccy.io. It seems like a great tool and would be a perfect fit, if we can get the resolver to work. Is there any information we can provide? Is there a timeline for a fix or an easy temporary workaround? Would love to help if it would be helpful.
This is available in master. We'll be cutting a release soon.
@kevineaton I switched to master as @djtarazona suggested.
Ah, I missed that. Perfect, thanks! Let me know if I can help test anything.
This has been fixed in v0.10.1
Detailed description
Recently upgraded to
speccy@0.9
and noticed a bug wherespeccy resolve api.yml -o output.yml
would create an empty file instead of writing the contents.Did not have any issues with this on
speccy@0.8
Context
We have a setup where we use both JSON schemas and OpenAPI 3 specifications and need to use
resolve
to build a "correct" specification.Possible implementation
The bug was introduced in https://github.com/wework/speccy/commit/f2f6936f2120652ede833a41f4af0ebcd8ab16c0#diff-4955107868977657681b5dd27b54457aR32, by adding the
return resolve
outside of thefs.writeFile
callback the process does not write any content to the file.Your environment
I tested this both using the NPM module and the docker image on
speccy@0.9
. Was also able to reproduce this on the latestmaster
withnode speccy.js resolve examples/petstore.yaml -o petstore.yaml