Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise a jour de la documentation swagger #35

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions src/main/java/fr/abes/bestppn/configuration/OpenAPIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,32 @@
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.List;

@Configuration
public class OpenAPIConfig {

@Value("${kafkaconvergence.openapi.url}")
private String url;

@Bean
public OpenAPI myOpenAPI() {
Server server = new Server();
server.setUrl(url);
server.setDescription("Server URL in Development environment");
public OpenAPI OpenAPI() {

Contact contact = new Contact();
contact.setName("Convergence");
contact.setUrl("https://");
contact.setName("Abes");
contact.setUrl("https://github.com/abes-esr/best-ppn-api");
contact.setEmail("[email protected]");

Info info = new Info()
.title("Convergence API")
.title("best-ppn-api")
.version("1.0")
.contact(contact)
.description("This API reads a TSV file, calculates the best PPN and sends the answer to Kafka.");
.description("This read a topic named bacon.kbart.toload which is one line from tsv file. Listener Kafka listens to a topic and retrieves messages as soon as they arrive. Uses services from " +
"https://www.sudoc.fr/services/printId2ppn" +
"https://www.sudoc.fr/services/onlineId2ppn" +
"https://www.sudoc.fr/services/doi2ppn" +
"https://www.sudoc.fr/services/dat2ppn" +
"to calculate the best ppn from one tsv live, thus, put the result into to topic bacon.kbart.withppn.toload");


return new OpenAPI().info(info).servers(List.of(server));
return new OpenAPI().info(info);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.io.IOException;
import java.net.URISyntaxException;

@Tag(name = "Convergence localhost", description = "Convergence localhost managements APIs")
@Tag(name = "Calcul du meilleur PPN", description = "API de calcul du meilleur PPN pour une ligne tsv")
@CrossOrigin(origins = "*")
@RestController
@Slf4j
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ topic.name.source.kbart=bacon.kbart.toload
spring.jpa.open-in-view=false

# SpringDoc Swagger
kafkaconvergence.openapi.url=
springdoc.swagger-ui.path=/convergence-documentation
springdoc.api-docs.path=/convergence-api-docs

Expand Down
Loading