Commit 597e4f7a authored by Sreenidhi Iyangar's avatar Sreenidhi Iyangar
Browse files

Evaluating swagger-ui part of application

parent 3c206deb
......@@ -105,6 +105,11 @@
<artifactId>springfox-bean-validators</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.23.0</version>
</dependency>
</dependencies>
<build>
......@@ -139,4 +144,77 @@
</plugins>
</build>
<profiles>
<profile>
<id> swagger-ui </id>
<build>
<plugins>
<!-- Step 1. - Download Swagger UI webjar -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>swagger ui</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.23.0</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Step 2. Add Swagger-ui Resources to the WAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources combine.children = "append">
<resource>
<directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/3.23.0</directory>
<includes>
<include>**/*.*</include>
</includes>
<targetPath>swagger-ui</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/3.23.0/index.html</file>
<replacements>
<replacement>
<token>https://petstore.swagger.io/v2/swagger.json</token>
<value>http://localhost:8080/metatdataswaggerui/openapi.json</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<body>
<center>
<h1>
Metadata Swagger UI
</h1>
</center>
</body>
</html>
\ No newline at end of file
{
"openapi": "3.0.2",
"info": {
"title": "AMP T2D Property registry API",
"description": "Property registry API for the project AMP-T2D",
"version": "1.0SNAPSHOT",
"termsOfService": "www.ebi.ac.uk/terms",
"contact": {
"name": "Property registry API Admin",
"url": "www.ebi.ac.uk",
"email": "prop@gmail.com"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/license/"
}
},
"servers": [
{
"url": "https://www.ebi.ac.uk/ega/ampt2d/propertyreg/1.0/",
"description": "Production server"
}
],
"paths": {
"/phenotypes": {
"get": {
"tags": [
"Phenotype Entity"
],
"summary": "find all phenotypes.",
"description": "Get all phenotypes of Type2Diabetes.",
"operationId": "GetPhenotypeEntity",
"parameters": [
{
"name": "page",
"in": "query",
"description": "Number of pages.",
"schema": {
"type": "string"
}
},
{
"name": "size",
"in": "query",
"description": "size of page.",
"schema": {
"type": "string"
}
},
{
"name": "sort",
"in": "query",
"description": "Ascending or descending.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK, Successful response",
"content": {
"application/json": {
"schema": {
"title": "Model",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "generated id of phenotype"
},
"phenotypeGroup": {
"type": "string",
"enum": [
"ANTHROPOMETRIC",
"CARDIOVASCULAR",
"GLYCEMIC"
],
"description": "phenotype group"
},
"description": {
"type": "string",
"description": "description of phenotype"
},
"type": {
"type": "string",
"enum": [
"DICHOTOMOUS",
"MULTICHOTOMOUS"
],
"description": "description of phenotype"
},
"allowedValues": {
"type": "string",
"description": "allowed values of phenotype"
}
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not found"
}
}
},
"post": {
"tags": [
"Phenotype Entity"
],
"summary": "save phenotype.",
"description": "Store a phenotype of Type2Diabetes.",
"operationId": "PostPhenotypeEntity",
"requestBody": {
"description": "Store a phenotype of Type2Diabetes.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Phenotype"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK, Successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"id": {
"type": "string"
},
"phenotypeGroup": {
"type": "string",
"enum": [
"ANTHROPOMETRIC",
"CARDIOVASCULAR",
"GLYCEMIC"
]
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"DICHOTOMOUS",
"MULTICHOTOMOUS"
]
},
"allowedValues": {
"type": "string"
}
}
}
}
}
},
"201": {
"description": "Created"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not found"
}
}
}
}
},
"components": {
"schemas": {
"Phenotype": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "generated id of phenotype"
},
"phenotypeGroup": {
"type": "string",
"enum": [
"ANTHROPOMETRIC",
"CARDIOVASCULAR",
"GLYCEMIC"
],
"description": "phenotype group"
},
"description": {
"type": "string",
"description": "description of phenotype"
},
"type": {
"type": "string",
"enum": [
"DICHOTOMOUS",
"MULTICHOTOMOUS"
],
"description": "description of phenotype"
},
"allowedValues": {
"type": "string",
"description": "allowed values of phenotype"
}
},
"xml": {
"name": "Phenotype"
}
}
},
"securitySchemes": {
"keycloak_auth": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"tokenUrl": "http://localhost:8080/ega/ampt2d/auth/realms/securemetadata/protocol/openid-connect/token",
"authorizationUrl": "http://localhost:8080/ega/ampt2d/auth/realms/securemetadata/protocol/openid-connect/auth",
"scopes": {
"opened": "openid"
}
}
}
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment