From 2061a3615aa6e8d6810b9ac74402726ce077668e Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Thu, 21 Apr 2022 22:40:50 -0400 Subject: Document changes for API springboot migration Issue-ID: POLICY-3925 Signed-off-by: Rashmi Pujar Change-Id: Ie517af1fd40c3eafcc758d3fd421a5ce8ca22517 --- docs/development/devtools/devtools.rst | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'docs/development/devtools/devtools.rst') diff --git a/docs/development/devtools/devtools.rst b/docs/development/devtools/devtools.rst index 787af683..9012caf8 100644 --- a/docs/development/devtools/devtools.rst +++ b/docs/development/devtools/devtools.rst @@ -253,9 +253,10 @@ running MariaDb database instance. The easiest way to do this is to run the dock information on doing so. Once the mariadb is up and running, a configuration file must be provided to the api in order for it to know how to connect to the mariadb. You can locate the default configuration file in the packaging of the api component: -`Default API Configuration `_ +`Default Policy API Configuration `_ -You will want to change the fields pertaining to "host", "port" and "databaseUrl" to your local environment settings. +You will want to change the fields pertaining to "host", "port" and "databaseUrl" to your local environment settings and start the +policy-api springboot application either using your IDE of choice or using the run goal from Spring Boot Maven plugin: *mvn spring-boot:run*. Running the API component using Docker Compose ++++++++++++++++++++++++++++++++++++++++++++++ @@ -347,6 +348,10 @@ the Policy Framework works in a full ONAP deployment. Generating Swagger Documentation ******************************** + +1. Using Swagger2Markup maven plugin from Policy Parent Integration POM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + The `Policy Parent Integration POM `_ contains a *generateSwaggerDocs* profile. This profile can be activated on any module that has a Swagger endpoint. When active, this profile creates a tarball in Nexus with the name *-swagger-docs.tar.gz*. The tarball contains the following files: @@ -394,6 +399,16 @@ of such a test case. See `this unit test case `_ for the full example. +2. Accessing Swagger documentation for springboot based policy applications ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Springfox Swagger2 maven dependency aids with auto-generation of Swagger documentation. + +Using the Swagger-UI maven dependency Swagger HTML documentation can be accessed at the root url. + +- The generated swagger.json can be accessed at: *https://service_IP:service_port/v2/api-docs* +- Swagger UI can be accessed at: *https://service_IP:service_port/swagger-ui/index.html* + Running the DMaaP Simulator during Development ********************************************** It is sometimes convenient to run the DMaaP simulator during development. You can run it from the command line using Maven or from within your IDE. -- cgit 1.2.3-korg