Skip to content

Commit

Permalink
Open Api Swagger added
Browse files Browse the repository at this point in the history
  • Loading branch information
imertetsu committed Aug 13, 2024
1 parent b1f28a3 commit ba834c0
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/main/java/com/spacecraft/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
package com.spacecraft.config;public class SwaggerConfig {
package com.spacecraft.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Collections;

@Configuration
public class SwaggerConfig {
@Value("${swagger.server.url}")
private String swaggerServerUrl;

@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()

.info(new Info()
.title("API Documentation")
.version("1.0")
.description("""
API designed to integrate spacecraft onboard event data with geographic position data (latitude and longitude). This application provides a REST API that allows users to retrieve the exact or closest geographic positions of the spacecraft at the time of various onboard events, ensuring accurate tracking and monitoring of the spacecraft's operational status.
\n Retrieve Event Position by ID: Users can request the precise geographic position (latitude and longitude) of the spacecraft at the time of a specific event by providing the event's unique ID.
\n List All Events with Positions: The application offers an endpoint to retrieve a comprehensive list of all onboard events, each accompanied by the corresponding latitude and longitude at the time of the event.""")
.contact(new Contact().name("Imer Coaguila").url("https://portafoliotetsu.web.app").email("[email protected]")))
.servers(Collections.singletonList(new Server().url(swaggerServerUrl)));
}
}

0 comments on commit ba834c0

Please sign in to comment.