core
core copied to clipboard
Update API Endpoints Base and Embedder to Version v2
Description
This pull request introduces v2 of existing API endpoints: base and embedder. The update ensures that the previous version continues to operate (though it is now deprecated) while offering improved and additional functionalities in v2. The Goal is to maintain backward compatibility and encourage users to transition to the new version due to its enhanced capabilities.
Changes:
- Deprecation Warning for Old API: The existing version of the API will remain operational but log a warning about its deprecation to encourage migration to v2.
- New v2 Endpoints: The endpoints now respond with models structured as JSON Schema to improve integration and consistency across services. The endpoint /settings/{languageEmbedderName} has been updated to /{languageEmbedderName}/settings in v2, better semantic ordering
- Endpoint Response Consistency: The upsert_embedder_setting_v2 endpoint has been modified to return the same response structure as get_embedder_settings_v2. This change simplifies the API and aligns the user experience across different operations. Also, the endpoint checks if the required fields are present in the current payload (otherwise raises an exception). Additionally, it enriches the payload by automatically inserting default values for any properties not supplied by the user but defined in the schema ( only for properties with a default value). This enhancement ensures greater consistency between the model representation and the stored data.
Related to issue #764
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
Thanks @dave90 , great contribution. Need time to review carefully, back to you soon :D
Hi @dave90 , I'm truly sorry but with the addition of custom auth handlers and user/permissions, the endpoints have been changing. I'm closing this PR and plan to refactor the endpoints as discussed for v2 directly (so there is no legacy). I'm closing this, sorry again :( your effort is much appreciated