Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
2ac2aeb2
Commit
2ac2aeb2
authored
5 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
update swagger
parent
97e2686e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!28
Swagger
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/gov/usgs/earthquake/nshmp/netcdf/swagger/UpdateSwagger.java
+11
-9
11 additions, 9 deletions
...v/usgs/earthquake/nshmp/netcdf/swagger/UpdateSwagger.java
with
11 additions
and
9 deletions
src/main/java/gov/usgs/earthquake/nshmp/netcdf/swagger/UpdateSwagger.java
+
11
−
9
View file @
2ac2aeb2
package
gov.usgs.earthquake.nshmp.netcdf.swagger
;
package
gov.usgs.earthquake.nshmp.netcdf.swagger
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
org.yaml.snakeyaml.DumperOptions
;
import
org.yaml.snakeyaml.DumperOptions
;
import
org.yaml.snakeyaml.Yaml
;
import
org.yaml.snakeyaml.Yaml
;
import
com.google.common.io.Resources
;
import
gov.usgs.earthquake.nshmp.netcdf.NshmGroup
;
import
gov.usgs.earthquake.nshmp.netcdf.NshmGroup
;
import
io.swagger.v3.oas.models.PathItem
;
import
io.swagger.v3.oas.models.PathItem
;
/**
/**
* Create Swagger files for each model and update context path.
* Create Swagger files for each model and update context path.
*
* @author U.S. Geological Survey
*/
*/
class
UpdateSwagger
{
class
UpdateSwagger
{
private
static
final
URL
SWAGGER_URL
=
Resources
.
getResource
(
"swagger"
);
private
static
final
Path
SWAGGER_DIR
=
Paths
.
get
(
"swagger-files"
);
private
static
final
Path
SWAGGER_DIR
=
Paths
.
get
(
"swagger-files"
);
private
static
final
Path
TARGET_FILE
;
private
static
final
Path
TARGET_FILE
;
private
static
final
String
OPENAPI_TARGET
=
"micronaut.openapi.target.file"
;
static
{
static
{
try
{
try
(
var
file
=
new
FileInputStream
(
"openapi.properties"
))
{
var
dir
=
Paths
.
get
(
SWAGGER_URL
.
toURI
());
var
properties
=
new
Properties
();
TARGET_FILE
=
dir
.
resolve
(
"netcdf-swagger.yml"
);
properties
.
load
(
file
);
}
catch
(
URISyntaxException
e
)
{
var
openapi
=
properties
.
getProperty
(
OPENAPI_TARGET
);
TARGET_FILE
=
Paths
.
get
(
openapi
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment