j-d-carmichael / boats

Beautiful Open Api Template System
MIT License
57 stars 8 forks source link

Unable to exclude root paths from injection #86

Closed celleb closed 9 months ago

celleb commented 10 months ago

Describe the bug A clear and concise description of what the bug is.

When using the inject template, it is not possible to exclude root paths from injections.

To Reproduce

{{ inject([ { toAllOperations: { content: { security: [{ jwtToken: [] }] }, excludePaths: [ '/towns', '/' ] } } ]) }}

Expected behavior The bundled specifications must not inject security into root paths.

Additional context Add any other context about the problem here.

j-d-carmichael commented 10 months ago

@Celleb could you please confirm on what path method types this is happening on?

eg: "paths/get.yml"

If not already, could you please confirm if this is also happening on a http verb starting with a letter after i, eg paths/post.yml

j-d-carmichael commented 10 months ago

By removing walker and adding a custom sort function to push any index to the top of the respective folder - we ensure the index files of the respective directory are resolved before others.

This was causing a bug in that http actions, GET and DELETE were being rendered before the index file of the respective folder. 99% of the time this was a non issue, but in the case where the injector was meant to inject into a /get.yml, it was ot injecting.

@Celleb could you please confirm in 4.9.3 resolves your issue

celleb commented 10 months ago

Build fails both with and without the paths/get.yml

j-d-carmichael commented 10 months ago

Could you provide a full example, please? Did you also check with the new release?

celleb commented 9 months ago

Sorry, all is good. It had something to do with my node version. False Alarm!!!