Skip to content
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

merger function return dump #80

Open
Themis3000 opened this issue Jul 30, 2022 · 0 comments
Open

merger function return dump #80

Themis3000 opened this issue Jul 30, 2022 · 0 comments

Comments

@Themis3000
Copy link

Themis3000 commented Jul 30, 2022

Right now, it appears that the merger function returns some sort of promise instead of the dump from the resulting merge. It would be nice if I where able to programmatically retrieve the dump without having to write to a file in the process.

Am I missing an important reason as to why this promise is returned instead of the dump? Is there I way I'm missing to get the dump without writing to a file?

e.g. I would like to be able to use this library like this:

//Merge yaml files
const spec = merger({
  input: './src/__docs__/index.yml',
  compact: false
})

//Feed directly into swagger
router.get("/", koaSwagger({
  routePrefix: "/docs",
  specPrefix: "/docs/spec",
  swaggerOptions: {spec}
}))

Edit: for now I forked this repo and frankensteined this functionality in, I won't pull request it because all other features of the repo besides what I'm specifically doing is untested and I have reason to believe it won't work at all haha. Thanks for making this project, it helps tidy up code a lot! After using this it feels like $ref#* should be a feature of swagger/openapi officially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant