-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs(admin): openapi custom data provider example #2116
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
docs(admin): openapi custom data provider example #2116
Conversation
@vinceAmstoutz could you take a look here? 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sounds good to me @igornast except for a few minor changes. To be sure I'll ask people who know more about the API Platform front-end and admin components.
Co-authored-by: Vincent Amstoutz <vincent.amstoutz@outlook.com>
Co-authored-by: Vincent Amstoutz <vincent.amstoutz@outlook.com>
admin/openapi.md
Outdated
|
||
try { | ||
const { status, headers, body, json } = await fetchUtils.fetchJson(url, options); | ||
console.log('HTTP Response:', { status, headers, body, json }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log('HTTP Response:', { status, headers, body, json }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanpoulain for the sake of example, we can even remove the whole try/catch clause. Maybe it makes more sense to keep it short here.
[...]
if (token) {
options.user = { token: `Bearer ${token}`, authenticated: true };
}
return await fetchUtils.fetchJson(url, options);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, it would be simpler!
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
Maybe it would be better to add it to the |
@alanpoulain just a quick update - I'm reviewing the authentication support page to see if there is a space for improvement by simplifying the example. I find the current version a bit hard to read and understand. |
@alanpoulain Please let me know if you find that structure readable and helpful. Comments and suggestions are welcome. :) |
I think it could be improved, especially the JWT section (not shared with the Hydra part), but it's already an improvement, thank you. |
@alanpoulain @vinceAmstoutz many thanks for your support. 🚀 ❤️ |
The pull request enhances the documentation for the Admin section by adding a comprehensive example of a custom dataProvider.
Goal:
To provide a more advanced, real-world example for developers who need to extend the OpenApiAdmin component with custom authentication and error handling.