diff --git a/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java b/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java index da5c6c907be9e73d1087b63699e3142b109b53ee..69f25638e1f10a0db3dda70d2e0b9d8ebb6af596 100644 --- a/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java +++ b/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java @@ -74,7 +74,7 @@ public class NetcdfController { "### Service call pattern\n" + "This service call is slashed delimited with pattern: " + - "`/spectra/{latitude}/{longitude}/{siteClass}`\n" + + "`/spectra/{longitude}/{latitude}/{siteClass}`\n" + "<br><br>" + "Example: `/spectra/-118/34/A`", operationId = "aashto-slash") @@ -84,11 +84,11 @@ public class NetcdfController { content = @Content( mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = Response.class))) - @Get(uri = "/{latitude}/{longitude}/{siteClass}", produces = MediaType.APPLICATION_JSON) + @Get(uri = "/{longitude}/{latitude}/{siteClass}", produces = MediaType.APPLICATION_JSON) public HttpResponse<String> doGetSlashBySite( HttpRequest<?> request, - @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable Double latitude, + @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable NehrpSiteClass siteClass) { var query = new Query(longitude, latitude, siteClass); return service.handleServiceCall(request, query); @@ -112,9 +112,9 @@ public class NetcdfController { "### Service call pattern\n" + "This service call is query based with pattern: " + - "`/spectra?latitude={number}&longitude={number}&siteClass={string}`\n" + + "`/spectra?longitude={number}&latitude={number}&siteClass={string}`\n" + "<br><br>" + - "Example: `/spectra?latitude=34&longitude=-118&siteClass=A`", + "Example: `/spectra?longitude=-118&latitude=34&siteClass=A`", operationId = "aashto-query") @ApiResponse( description = "Spatially interpolates data from https://doi.org/10.5066/P9Z206HY", @@ -122,11 +122,11 @@ public class NetcdfController { content = @Content( mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = Response.class))) - @Get(uri = "{?latitude,longitude,siteClass}", produces = MediaType.APPLICATION_JSON) + @Get(uri = "{?longitude,latitude,siteClass}", produces = MediaType.APPLICATION_JSON) public HttpResponse<String> doGet( HttpRequest<?> request, - @Schema(required = true) @QueryValue @Nullable Double longitude, @Schema(required = true) @QueryValue @Nullable Double latitude, + @Schema(required = true) @QueryValue @Nullable Double longitude, @QueryValue @Nullable NehrpSiteClass siteClass) { var query = new Query(longitude, latitude, siteClass); return service.handleServiceCall(request, query); @@ -140,7 +140,7 @@ public class NetcdfController { * @param latitude Latitude of the site */ @Hidden - @Get(uri = "/{latitude}/{longitude}", produces = MediaType.APPLICATION_JSON) + @Get(uri = "/{longitude}/{latitude}", produces = MediaType.APPLICATION_JSON) public HttpResponse<String> doGetSlash( HttpRequest<?> request, @Schema(required = true) @PathVariable @Nullable Double longitude, diff --git a/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerController.java b/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerController.java index c56272ff454d18f904d5d4f8718cbac5ed9e9780..5bd776c0040d70de43e8e21763d8533b1170b53d 100644 --- a/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerController.java +++ b/src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerController.java @@ -75,14 +75,14 @@ public class SwaggerController { "The query based service call is in the form of:\n" + "```text\n" + - url + "/spectra?latitude={number}&longitude={number}\n" + - url + "/spectra?latitude={number}&longitude={number}&siteClass={string}\n" + + url + "/spectra?longitude={number}&latitude={number}\n" + + url + "/spectra?longitude={number}&latitude={number}&siteClass={string}\n" + "````\n" + "Example:\n" + "```text\n" + - url + "/spectra?latitude=34&longitude=-118\n" + - url + "/spectra?latitude=34&longitude=-118&siteClass=BC\n" + + url + "/spectra?longitude=-118&latitude=34\n" + + url + "/spectra?longitude=-118&latitude=34&siteClass=BC\n" + "```\n") .append( "### Slash Pattern\n" + @@ -90,15 +90,15 @@ public class SwaggerController { "The slash based service call is in the form of:\n" + "```text\n" + - url + "/spectra/{latitude}/{longitude}\n" + - url + "/spectra/{latitude}/{longitude}/{siteClass}\n" + + url + "/spectra/{longitude}/{latitude}\n" + + url + "/spectra/{longitude}/{latitude}/{siteClass}\n" + "```\n" + "Example:\n" + "```text\n" + - url + "/spectra/34/-118\n" + - url + "/spectra/34/-118/BC\n" + + url + "/spectra/-118/34\n" + + url + "/spectra/-118/34/BC\n" + "```\n") .append("</details>") .toString(); diff --git a/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java b/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java index 4d62342265828a89003968d230ca53a2cdfe8b7e..ea2eea3699c4ae06360ca804487ce0628ab0d26f 100644 --- a/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java +++ b/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java @@ -89,8 +89,8 @@ public class NetcdfController { @Get(uri = "/{longitude}/{latitude}/{siteClass}/{imt}", produces = MediaType.APPLICATION_JSON) public HttpResponse<String> doGetSlashByImt( HttpRequest<?> request, - @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable Double latitude, + @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable NehrpSiteClass siteClass, @Schema(required = true) @PathVariable @Nullable Imt imt) { return doGet(request, longitude, latitude, siteClass, imt); @@ -125,8 +125,8 @@ public class NetcdfController { @Get(uri = "/{longitude}/{latitude}/{siteClass}", produces = MediaType.APPLICATION_JSON) public HttpResponse<String> doGetSlashBySite( HttpRequest<?> request, - @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable Double latitude, + @Schema(required = true) @PathVariable @Nullable Double longitude, @Schema(required = true) @PathVariable @Nullable NehrpSiteClass siteClass) { return doGet(request, longitude, latitude, siteClass, null); } diff --git a/src/lib/src/main/resources/swagger/index.css b/src/lib/src/main/resources/swagger/index.css index 65654e10316ec39c136e0937bd29b88cce034669..b514b935545bc9401d16f678674db2c91e44f4bb 100644 --- a/src/lib/src/main/resources/swagger/index.css +++ b/src/lib/src/main/resources/swagger/index.css @@ -12,7 +12,7 @@ body { } #swagger-ui { - padding-top: 1em; + padding-top: 2em; padding-bottom: 50px; } @@ -74,8 +74,25 @@ body { /* ---- Disclaimer ---- */ +.wrapper { + box-sizing: border-box; + margin: 0 auto; + max-width: 1460px; + padding: 0 20px; + width: 100%; +} + +@media only screen and (max-width: 1000px) { + .alert { + line-height: 1.1 !important; + font-size: 10px !important; + } +} + .alert { - background-color: #fdf7dc; + background-color: #fff3cd; + border-color: #ffecb5; + box-shadow: 0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f; line-height: 1.5; margin: 1em 1em 0 1em; overflow: hidden; diff --git a/src/lib/src/main/resources/swagger/index.html b/src/lib/src/main/resources/swagger/index.html index 625663ff98b7f700165b802544f5add3c3b0ecee..9625e8d0d056512a3a07398f6c98cb7f1121cc3b 100644 --- a/src/lib/src/main/resources/swagger/index.html +++ b/src/lib/src/main/resources/swagger/index.html @@ -35,21 +35,21 @@ </div> </header> - <div class="alert" role="alert"> - This software is preliminary or provisional and is subject to revision. - It is being provided to meet the need for timely best science. - The software has not received final approval by the U.S. Geological Survey (USGS). - No warranty, expressed or implied, is made by the USGS or the U.S. Government as to - the functionality of the software and related material nor shall the fact of release - constitute any such warranty. The software is provided on the condition that neither - the USGS nor the U.S. Government shall be held liable for any damages resulting from - the authorized or unauthorized use of the software. + <div class="wrapper"> + <div class="alert" role="alert"> + This software is preliminary or provisional and is subject to revision. + It is being provided to meet the need for timely best science. + The software has not received final approval by the U.S. Geological Survey (USGS). + No warranty, expressed or implied, is made by the USGS or the U.S. Government as to + the functionality of the software and related material nor shall the fact of release + constitute any such warranty. The software is provided on the condition that neither + the USGS nor the U.S. Government shall be held liable for any damages resulting from + the authorized or unauthorized use of the software. + </div> </div> <div id="swagger-ui"></div> - - <footer class="nshmp-template-footer"> <a href="https://code.usgs.gov/ghsc/nshmp/nshmp-ws-static/-/blob/main/LICENSE.md"> License