adonis-autoswagger icon indicating copy to clipboard operation
adonis-autoswagger copied to clipboard

Load models from a different folder

Open hugojeanmaire1 opened this issue 1 year ago • 4 comments

Hello, it would be nice to load models from a different folder. 😄

Keep these by default:

  • Creates schemas automatically based on app/Models/*
  • Creates schemas automatically based on app/Interfaces/*
  • Creates schemas automatically based on app/Validators/* (only for adonisJS v6)

And add something like:

  • Creates schemas automatically based on a given path and checks subfolders

hugojeanmaire1 avatar Sep 05 '24 09:09 hugojeanmaire1

In adonisv6 you can set custom folders for models, controllers, etc... in package.json which AutoSwagger respects.

If you mean adding additional folders (outside of the default ones), then may I ask why you'd want to do that? Since "convention over configuration" is usually the proper way to go with.

ad-on-is avatar Sep 05 '24 09:09 ad-on-is

I understand what you said, but I have a clean architecture in AdonisV6 and I want to use this package to expose my API with Swagger. So I want to expose for multiple bounded context in Swagger with these exemples:

  • authentication/infrastructure/primary/**/Rest*.ts
  • marketplace/infrastructure/primary/**/Rest*.ts

hugojeanmaire1 avatar Oct 01 '24 07:10 hugojeanmaire1

Hi,

First, thank you for this amazing package.

I have the same situation as you @hugojeanmaire1. Did you find a solution ?

Thank you in advance, for your help.

himito avatar Feb 10 '25 19:02 himito

Hello @himito

No, I didn't find any solution for this problem. I just stopped using this package. But it would be nice to re-open this issue and find a solution?

hugojeanmaire1 avatar Feb 11 '25 09:02 hugojeanmaire1