javanile / yamlinc

Compose multiple YAML files into one with $include tag. Split Swagger/OpenAPI into multiple YAML files.
MIT License
114 stars 22 forks source link

Some includes fail #16

Closed didac-wh closed 5 years ago

didac-wh commented 5 years ago

It doesn't seem to be directly related with yamlinc, but with a dependency of it: https://www.npmjs.com/package/cuid As I'm writing this, "Published 8 hours ago".

I use Yamlinc as a dependency for my swagger definitions and some of the includes are not working since today. In every deploy I reinstall the dependencies, so it all points to cuid package working differently than yesterday.

francescobianco commented 5 years ago

Hi @didac-wh

Actually this fix https://github.com/javanile/yamlinc/commit/1f837af8567ef582ae12753f7044ac2aef6f259f

try to update to yamlinc@0.1.7 https://www.npmjs.com/package/yamlinc/v/0.1.7

your support is gold for me, thanks!

didac-wh commented 5 years ago

Hello @francescobianco Thanks for the package and for the quick action.

Unfortunately the problem seems to persist, this time with a low dash character "_".

Example: $include_cjrw5r46q002b6pnm71vvbvk

Hope it helps :)

ericelliott commented 5 years ago

Hi guys, if cuid is generating characters that are causing you problems, I'd like to issue fixes in the cuid library so the whole ecosystem benefits. Please feel free to PR.

ericelliott commented 5 years ago

FYI, that underscore is NOT being generated by cuid. Cuids always begin with c.

cuid: cjrw5r46q002b6pnm71vvbvk Prepended by something else: $include_

Cuid also does not generate underscores:

Array.from({ length: 1000000 }, x => cuid()).filter(id => /_/.test(id))
// []
francescobianco commented 5 years ago

Hi @didac-wh @ericelliott

The last update can be the best one https://github.com/javanile/yamlinc/commit/5858a1101b942cdbca06d6ba43295f7249b02036

try to update to yamlinc@0.1.8 https://www.npmjs.com/package/yamlinc/v/0.1.8

Thanks