laravel-orion icon indicating copy to clipboard operation
laravel-orion copied to clipboard

OpenAPI specs for custom endpoints

Open Testinger opened this issue 2 years ago • 1 comments

Hi,

I'm using Laravel Sanctum for Authentication purposes, and I would like to add the route generated by Sanctum to Orion generated OpenAPI Specs file. From what I understand, the paths generated came from PathsBuilder from resourcesCacheStore, which I assume registered when using Orion::resource on routes file.

image

This works great with Orion specified Collections and operations, but it can't register any custom functions individually declared on routes file.

image

At the example above, Announcement and Banner were successfully generated, but routes such as /register, /login, and /me were not specified on specs.json file. Are there any way we can add these on specs file, or am I missing something? Thank you!

Testinger avatar Sep 19 '22 16:09 Testinger

Hi @Testinger,

At this point, Orion cannot generate OpenAPI specs for custom endpoints (endpoints defined outside of Orion:: route scope), but I am working on making it possible to generate specs for such endpoints too.

For now, you can just add the necessary specs manually into the generated file - Orion won't remove those upon specs generation.

alexzarbn avatar Sep 20 '22 14:09 alexzarbn