Skip to content

-o/--output flag outputs an empty file #276

@bramdevries

Description

@bramdevries

Detailed description

Recently upgraded to [email protected] and noticed a bug where speccy resolve api.yml -o output.yml would create an empty file instead of writing the contents.

Did not have any issues with this on [email protected]

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 f2f6936#diff-4955107868977657681b5dd27b54457aR32, by adding the return resolve outside of the fs.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 [email protected]. Was also able to reproduce this on the latest master with node speccy.js resolve examples/petstore.yaml -o petstore.yaml

  • Node Version: 8.12.0
  • Operating system and version: MacOS 10.14.2
  • Docker Version: 18.09.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions