[MGNLREST-84] Custom endpoints no longer show up in REST Tools (Swagger UI) Created: 15/Feb/17 Updated: 12/May/17 Resolved: 12/May/17 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | tools |
| Affects Version/s: | 1.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Nickolaus Wing | Assignee: | Unassigned |
| Resolution: | Not an issue | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
I wrote and contributed the forge module "magnolia-rest-queries" that adds a RESTful interface for executing JCR queries. After this latest swagger update my endpoint no longer appears in the REST Tools interface. I checked /.rest/swagger.json and it is also missing from there. The module configures itself according to the documentation provided here: https://documentation.magnolia-cms.com/display/DOCS/REST+API#RESTAPI-Exposingyourownendpoints It was working well in 5.4.x. It looks like the new Swagger re-organized things and now you're generating /.rest/swagger.json instead of /.rest/api-docs. I would guess that the code that generates swagger.json is failing to look in other module configurations for a /rest-endpoints/ node, but that is simply a guess. RESTful requests to the endpoint do continue to work correctly. |
| Comments |
| Comment by Philip Mundt [ 27/Feb/17 ] |
|
Hi nwing. Thanks for reporting this issue. It is indeed true that your custom endpoint should not appear in the REST tools anymore. This is due to To get your endpoint back in the tools, you need to bump your swagger dependency and adjust the imports in your custom endpoint: import com.wordnik.swagger.annotations.Api; import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiResponse; import com.wordnik.swagger.annotations.ApiResponses; To: import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; Also see this PR for more details: https://git.magnolia-cms.com/projects/MODULES/repos/rest/pull-requests/3/overview I hope this helps. |
| Comment by Philip Mundt [ 11/May/17 ] |
|
nwing is this still an issue or did suggested fix solve the problem? |
| Comment by Nickolaus Wing [ 12/May/17 ] |
|
That did solve the problem. I updated the REST queries module accordingly. Thanks! |