Skip to content

thiagolvlsantos/rest-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rest-storage

CI with Maven CI with CodeQL CI with Sonar Quality Gate Status Coverage Maven Central Hex.pm

A generic endpoint to storage of objects.

Usage

Include latest version Maven Central to your project.

		<dependency>
			<groupId>io.github.thiagolvlsantos</groupId>
			<artifactId>rest-storage</artifactId>
			<version>${latestVersion}</version>
		</dependency>

Add @EnableRestStorage to you app.

...
@EnableRestStorage
public class Application {
	...main(String[] args) {...}
}

Configuration

Example using YAMLs configuration file.

# OpenAPI params
springdoc:
  api-docs:
    path: /swagger
  swagger-ui:
    path: /swagger/ui
    operationsSorter: alpha # Sorting endpoints alphabetically
    tagsSorter: alpha       # Sorting tags alphabetically

Rest Handler

Extend AbstractRestHandler to receive all events based on entity type. You can, as example, implement a service for a given entity based on file-storage or using jpa + hibernate to save objects.

Endpoints

According to this setup, after server start, the OpenApi interface will be available at http://localhost:8080/swagger and Swagger UI at http://localhost:8080/swagger/ui.

Auto-generated API

Build

Localy, from this root directory call Maven commands or bin/<script name> at your will...