Skip to content
Snippets Groups Projects

Resolves - Remove GITLAB_TOKEN Requirement and AASHTO-2023 web service -- add CSV response

3 files
+ 158
21
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -23,6 +23,7 @@ import io.micronaut.runtime.event.annotation.EventListener;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -70,13 +71,24 @@ public class NetcdfController {
description = "### Returns a risk-targeted design response spectrum for a " +
"user-specified latitude, longitude, and site class.\n" +
"Enter the latitude and longitude select the site class, and press `Execute`.\n" +
"Enter the latitude and longitude, select the site class " +
"and format (optional), and press `Execute`.\n" +
"### Service Response Types\n" +
"The web service can respond in JSON or CSV format.\n" +
"<br><br>" +
"Choose the format type by adding a `format` query to the service call:" +
"`?format=JSON` or `?format=CSV`\n" +
"<br><br>" +
"Default: `JSON`\n\n" +
"### Service Call Pattern\n" +
"This service call is slashed delimited with pattern: " +
"`/spectra/{longitude}/{latitude}/{siteClass}`\n" +
"<br><br>" +
"Example: `/spectra/-118/34/A`\n",
"Example: `/spectra/-118/34/A`\n" +
"<br><br>" +
"CSV Example: `/spectra/-118/34/A?format=CSV`\n",
operationId = "aashto-slash")
@ApiResponse(
description = "Spatially interpolates data from https://doi.org/10.5066/P9Z206HY",
@@ -86,7 +98,14 @@ public class NetcdfController {
mediaType = MediaType.APPLICATION_JSON,
schema = @Schema(implementation = Response.class)),
@Content(
mediaType = MediaType.TEXT_CSV)
mediaType = MediaType.TEXT_CSV,
examples = @ExampleObject(
name = "CSV",
value = "AASHTO-2023 Web Service\n" +
"\n" +
"Longitude,-105.0,Latitude,40.0,SiteClass,BC\n" +
"Period (s),0.0,0.01,0.02,0.03,0.05,0.075, ...\n" +
"Spectral Acceleration (g),0.073,0.08,0.12,0.14,0.18, ...\n"))
})
@Get(uri = "/{longitude}/{latitude}/{siteClass}{?format}",
produces = { MediaType.APPLICATION_JSON, MediaType.TEXT_CSV })
Loading