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

OpenAPI specs for custom endpoints #180

Open
Testinger opened this issue Sep 19, 2022 · 1 comment
Open

OpenAPI specs for custom endpoints #180

Testinger opened this issue Sep 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Testinger
Copy link

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!

@alexzarbn
Copy link
Member

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 alexzarbn changed the title How to add Laravel Sanctum and custom functions to OpenAPI specs OpenAPI specs for custom endpoints Sep 20, 2022
@alexzarbn alexzarbn added the enhancement New feature or request label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants