-
Notifications
You must be signed in to change notification settings - Fork 25
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
API docs and api initial v2 #615
Conversation
datenangebot
commented
Oct 12, 2023
•
edited
Loading
edited
- add annotations for API routed methods
- refactor to ensure type safety
- add psalm types and usage
- introduce new api v2 structure
- refactor integration tests / add for api v2
ef5366b
to
f525e06
Compare
@juliushaertl I don't need this when using the ocs routes, right? https://github.com/nextcloud/tables/pull/615/files#diff-6301937af1cc1575e9e18ecd27c4a51f0d3cf9ce12e59a14709f626dfa3ef952R9-R10 Here is a APIignore because of an psalm/api-docs error. It's known and in progress. https://github.com/nextcloud/tables/pull/615/files#diff-70e5309fcd3311d771b3db9c93490ea270fd5894769093765ec37edb68e5dd9bR24 |
I'm not sure what you mean? You shouldn't have |
Hello there, We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
Yes, this is only needed for CORS annotated controllers, not for OCS ones.
Why not? The page controller that serves the page doesn't get a CSRF token passed by the browser. This is one of the rare cases that should have the |
@provokateurin for testing: I guess this
|
|
Hello there, We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
d4c4fe3
to
98ffe2f
Compare
@juliushaertl @provokateurin Do you think this is a proper way to handle this kind of parameter right now? https://github.com/nextcloud/tables/blob/doc/api_docs_workshop/lib/Controller/ApiColumnsController.php#L212-L213 (The api extractor would not parse a deep array structure description directly.) |
Wouldn't it be possible to define a custom type as it is actually an object json structure and not an array? Btw. feel free to also leave such comments directly as as review comment, then such discussions are directly linked to the code and can be threaded/resolved a bit easier as a individual topic ;) |
This is possible, but there is no way to tell psalm that a string is actually a json encoded object. So the structure itself can be properly documented, just not that it is used here (except for a comment). |
35e84f1
to
74414cb
Compare
- adjust setup to make use of the new API extractor - add all needed types to extract API v1 - setup structure and first endpoints for API v2 add selection column description and test it Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> fix php 7.4 backwards compatibility Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> add tests for basic column creations Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> add a endpoint to request column objects Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> update openapi.json Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> make psalm return type more precise Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> fix psalm types recognition Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> fix route Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> cleanup debug info Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Cleanup annotations Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Hide sensitive data from showing to the users. Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Refactor OCS-API-Controller to abstract class Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Update lib/Db/Column.php Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: Florian <florian.steffens@nextcloud.com> Update lib/Controller/ApiGeneralController.php Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: Florian <florian.steffens@nextcloud.com> Update lib/Controller/ApiTablesController.php Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: Florian <florian.steffens@nextcloud.com> Update lib/Controller/ApiTablesController.php Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: Florian <florian.steffens@nextcloud.com> Update lib/Controller/MyOCSController.php Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: Florian <florian.steffens@nextcloud.com> add specific endpoints to create different columns by type - fix error handling in ColumnService.php Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> add basic integration tests for the api v2 table endpoints Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> fix api routes & update API docs Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> cypress fix typo Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> initial new API setup - introduce api v2 - organise API methods in own controllers - Add virtual version tag to the names in docs - use OCS routes and controllers Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Setup skeleton to keep old api v1 and setup v2 with integration testing Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> try to use php8.1 for over all CI Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> add openapi.json Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> CI settings Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Make use of automated API doc generating - add annotations for API routed methods - refactor to ensure type safety - add psalm types and usage - correct API return codes ⚡️breaking changes ⚡️ Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
74414cb
to
046e7ec
Compare