[MGNLREST-38] Allow swagger base path to be configured relative to web application context path Created: 11/Nov/13 Updated: 13/Nov/13 Resolved: 13/Nov/13 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.0 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Tobias Mattsson | Assignee: | Tobias Mattsson |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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)
|
| Date of First Response: | |
| Epic Link: | REST support |
| Sprint: | 5.2-rc1 |
| Description |
|
If we were to configure instead '/.rest' on the module and then check if it starts with http:// or https:// and otherwise change it by prepending it with the context path we could make the module work out of the box without configuration. The tools app would instead open '/.resources/swagger-ui/index.html?apiBasepath=/magnoliaAuthor/.rest' which works. The result of calling 'http://localhost:8080/magnoliaAuthor/.rest/api-docs/properties/v1' however changes the 'basePath' property from being absolute with protocol and host to being absolute without protocol and host. I.e. /magnoliaAuthor/.rest as opposed to http://localhost:8080/magnoliaAuthor/.rest. Which might not work with other tools without reconfiguring. |
| Comments |
| Comment by Philip Mundt [ 12/Nov/13 ] |
|
Doesn't work if Magnolia runs on custom port, e.g. 8080 as library used by Swagger UI doesn't properly read port from window (see: https://github.com/automatthew/shred/issues/60). Will revert commits. |
| Comment by Philip Mundt [ 13/Nov/13 ] |
|
Bug fix (see: https://github.com/automatthew/shred/issues/60) in library shred solved requesting the endpoint, but didn't show the correct Request URL ("null"). Closing this improvement for now. |