diff --git a/apps/bioschemas-api/src/main/java/eu/dnetlib/bioschemas/api/MainApplication.java b/apps/bioschemas-api/src/main/java/eu/dnetlib/bioschemas/api/MainApplication.java index 53713a06..14bcb093 100644 --- a/apps/bioschemas-api/src/main/java/eu/dnetlib/bioschemas/api/MainApplication.java +++ b/apps/bioschemas-api/src/main/java/eu/dnetlib/bioschemas/api/MainApplication.java @@ -6,11 +6,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; + + + + + @SpringBootApplication @EnableSwagger2 diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceApplication.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceApplication.java index 763299ca..4c24d62c 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceApplication.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceApplication.java @@ -1,14 +1,19 @@ package eu.dnetlib.broker; +import java.util.ArrayList; +import java.util.List; + +import org.springdoc.core.GroupedOpenApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; import eu.dnetlib.common.app.AbstractDnetApp; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Tag; -import springfox.documentation.spring.web.plugins.Docket; +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.tags.Tag; @SpringBootApplication public class LiteratureBrokerServiceApplication extends AbstractDnetApp { @@ -24,22 +29,30 @@ public class LiteratureBrokerServiceApplication extends AbstractDnetApp { SpringApplication.run(LiteratureBrokerServiceApplication.class, args); } - @Override - protected void configSwagger(final Docket docket) { - docket.select() - .apis(RequestHandlerSelectors.any()) - .paths(p -> p.startsWith("/api/")) - .build() - .tags(new Tag(TAG_EVENTS, "Events management"), new Tag(TAG_SUBSCRIPTIONS, "Subscriptions management"), new Tag(TAG_NOTIFICATIONS, - "Notifications management"), new Tag(TAG_TOPIC_TYPES, "Topic types management"), new Tag(TAG_OPENAIRE, "OpenAIRE use case")) - .apiInfo(new ApiInfoBuilder() - .title("Literature Broker Service") - .description("APIs documentation") - .version("1.1") - .contact(ApiInfo.DEFAULT_CONTACT) - .license("Apache 2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0") - .build()); + @Bean + public GroupedOpenApi publicApi() { + return GroupedOpenApi.builder() + .group("Broker APIs") + .pathsToMatch("/api/**") + .build(); + } + @Override + protected void configSwagger(final OpenAPI openApi) { + final List tags = new ArrayList<>(); + tags.add(new Tag().name(TAG_EVENTS).description("Events management")); + tags.add(new Tag().name(TAG_SUBSCRIPTIONS).description("Subscriptions management")); + tags.add(new Tag().name(TAG_NOTIFICATIONS).description("Notifications management")); + tags.add(new Tag().name(TAG_TOPIC_TYPES).description("Topic types management")); + tags.add(new Tag().name(TAG_OPENAIRE).description("OpenAIRE use case")); + + openApi.info(new Info().title("Literature Broker Service") + .description("APIs documentation") + .version("1.1") + .license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0"))) + .externalDocs(new ExternalDocumentation() + .description("SpringShop Wiki Documentation") + .url("https://springshop.wiki.github.org/docs")) + .tags(tags); } } diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceConfiguration.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceConfiguration.java index a92f8862..785b9e5f 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceConfiguration.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/LiteratureBrokerServiceConfiguration.java @@ -16,10 +16,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import eu.dnetlib.broker.common.elasticsearch.Event; import eu.dnetlib.broker.common.elasticsearch.Notification; import eu.dnetlib.broker.common.properties.ElasticSearchProperties; -import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration -@EnableSwagger2 @EnableCaching @EnableScheduling @EnableTransactionManagement diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/EventsController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/EventsController.java index 5a981252..2f8f790a 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/EventsController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/EventsController.java @@ -31,12 +31,12 @@ import eu.dnetlib.broker.common.elasticsearch.EventStatsManager.BrowseEntry; import eu.dnetlib.broker.common.subscriptions.Subscription; import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @RestController @RequestMapping("/api/events") -@Api(tags = LiteratureBrokerServiceApplication.TAG_EVENTS) +@Tag(name = LiteratureBrokerServiceApplication.TAG_EVENTS) public class EventsController extends AbstractDnetController { private static final Log log = LogFactory.getLog(AbstractDnetController.class); @@ -50,25 +50,25 @@ public class EventsController extends AbstractDnetController { @Autowired private EventStatsManager eventStatsManager; - @ApiOperation("Return an event by ID") + @Operation(summary = "Return an event by ID") @GetMapping("/{id}") public Event getEvent(@PathVariable final String id) { return eventRepository.findById(id).get(); } - @ApiOperation("Delete an event by ID") + @Operation(summary = "Delete an event by ID") @DeleteMapping("/{id}") public void deleteEvent(@PathVariable final String id) { eventRepository.deleteById(id); } - @ApiOperation("Save an event by ID") + @Operation(summary = "Save an event by ID") @PostMapping("/{id}") public Event saveEvent(@RequestBody final Event event) { return eventRepository.save(event); } - @ApiOperation("Return a page of events") + @Operation(summary = "Return a page of events") @GetMapping("/list/{page}/{pageSize}") public List events( @PathVariable final int page, @@ -76,7 +76,7 @@ public class EventsController extends AbstractDnetController { return Lists.newArrayList(eventRepository.findAll(PageRequest.of(page, pageSize))); } - @ApiOperation("Return a page of events by topic") + @Operation(summary = "Return a page of events by topic") @GetMapping("/byTopic/{page}/{pageSize}") public List eventsByTopic( @PathVariable final int page, @@ -85,7 +85,7 @@ public class EventsController extends AbstractDnetController { return Lists.newArrayList(eventRepository.findByTopic(topic, PageRequest.of(page, pageSize))); } - @ApiOperation("Delete all the events") + @Operation(summary = "Delete all the events") @DeleteMapping("/all") public Map clearEvents() { eventRepository.deleteAll(); @@ -94,13 +94,13 @@ public class EventsController extends AbstractDnetController { return res; } - @ApiOperation("Delete the expired events") + @Operation(summary = "Delete the expired events") @DeleteMapping("/expired") public Map deleteExpiredEvents() { return deleteEventsByExpiryDate(0, new Date().getTime()); } - @ApiOperation("Delete the events with the creationDate in a range") + @Operation(summary = "Delete the events with the creationDate in a range") @DeleteMapping("/byCreationDate/{from}/{to}") public Map deleteEventsByCreationDate(@PathVariable final long from, @PathVariable final long to) { final Map res = new HashMap<>(); @@ -113,7 +113,7 @@ public class EventsController extends AbstractDnetController { return res; } - @ApiOperation("Delete the events with the expiryDate in a range") + @Operation(summary = "Delete the events with the expiryDate in a range") @DeleteMapping("/byExpiryDate/{from}/{to}") public Map deleteEventsByExpiryDate(@PathVariable final long from, @PathVariable final long to) { new Thread(() -> { @@ -128,13 +128,13 @@ public class EventsController extends AbstractDnetController { return res; } - @ApiOperation("Return the topics of the indexed events (all)") + @Operation(summary = "Return the topics of the indexed events (all)") @GetMapping("/topics/all") public List browseTopics() { return eventStatsManager.browseTopics(); } - @ApiOperation("Return the topics of the indexed events (only with subscriptions)") + @Operation(summary = "Return the topics of the indexed events (only with subscriptions)") @GetMapping("/topics/withSubscriptions") public List browseTopicsWithSubscriptions() { diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/NotificationsController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/NotificationsController.java index 6630d6ba..8c0330d3 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/NotificationsController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/NotificationsController.java @@ -14,16 +14,15 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import eu.dnetlib.broker.LiteratureBrokerServiceApplication; import eu.dnetlib.broker.common.elasticsearch.Notification; import eu.dnetlib.broker.common.elasticsearch.NotificationRepository; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @RestController @RequestMapping("/api/notifications") -@Api(tags = LiteratureBrokerServiceApplication.TAG_NOTIFICATIONS) +@Tag(name = "LiteratureBrokerServiceApplication.TAG_NOTIFICATIONS") public class NotificationsController extends AbstractDnetController { private static final Log log = LogFactory.getLog(NotificationsController.class); @@ -31,31 +30,31 @@ public class NotificationsController extends AbstractDnetController { @Autowired private NotificationRepository notificationRepository; - @ApiOperation("Return a notification by ID") + @Operation(summary = "Return a notification by ID") @GetMapping("/{id}") public Notification getNotification(@PathVariable final String id) { return notificationRepository.findById(id).get(); } - @ApiOperation("Delete a notification by ID") + @Operation(summary = "Delete a notification by ID") @DeleteMapping("/{id}") public void deleteNotification(@PathVariable final String id) { notificationRepository.deleteById(id); } - @ApiOperation("Save a notification by ID") + @Operation(summary = "Save a notification by ID") @PostMapping("/{id}") public Notification saveNotification(@RequestBody final Notification notification) { return notificationRepository.save(notification); } - @ApiOperation("Delete all notifications") + @Operation(summary = "Delete all notifications") @DeleteMapping("") public void deleteAllNotifications() { notificationRepository.deleteAll(); } - @ApiOperation("Delete the notifications with the date in a range") + @Operation(summary = "Delete the notifications with the date in a range") @DeleteMapping("/byDate/{from}/{to}") public Map deleteNotificationsByDate(@PathVariable final long from, @PathVariable final long to) { new Thread(() -> { diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/StartMatchingController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/StartMatchingController.java index b5ed84e9..2410f367 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/StartMatchingController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/StartMatchingController.java @@ -16,13 +16,13 @@ import eu.dnetlib.broker.common.subscriptions.Subscription; import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository; import eu.dnetlib.broker.matchers.SubscriptionEventMatcher; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @Profile("!openaire") @RestController @RequestMapping("/api/matching") -@Api(tags = LiteratureBrokerServiceApplication.TAG_MATCHING) +@Tag(name = LiteratureBrokerServiceApplication.TAG_MATCHING) public class StartMatchingController extends AbstractDnetController { @Autowired @@ -31,7 +31,7 @@ public class StartMatchingController extends AbstractDnetController { @Autowired(required = false) private SubscriptionEventMatcher subscriptionEventMatcher; - @ApiOperation("Launch the thread that produces new notifications") + @Operation(summary = "Launch the thread that produces new notifications") @GetMapping("/start") public List startMatching() { if (subscriptionEventMatcher != null) { @@ -42,7 +42,7 @@ public class StartMatchingController extends AbstractDnetController { } } - @ApiOperation("Launch the thread that produces new notifications by subscriptuion id") + @Operation(summary = "Launch the thread that produces new notifications by subscriptuion id") @GetMapping("/start/{subscriptionId}") public List startMatching(@PathVariable final String subscriptionId) { final Optional s = subscriptionRepo.findById(subscriptionId); diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/SubscriptionsController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/SubscriptionsController.java index ccc90c3b..ae587f1a 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/SubscriptionsController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/SubscriptionsController.java @@ -29,12 +29,12 @@ import eu.dnetlib.broker.common.subscriptions.NotificationMode; import eu.dnetlib.broker.common.subscriptions.Subscription; import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @RestController @RequestMapping("/api/subscriptions") -@Api(tags = LiteratureBrokerServiceApplication.TAG_SUBSCRIPTIONS) +@Tag(name = LiteratureBrokerServiceApplication.TAG_SUBSCRIPTIONS) public class SubscriptionsController extends AbstractDnetController { @Autowired @@ -53,26 +53,26 @@ public class SubscriptionsController extends AbstractDnetController { } }; - @ApiOperation("Return the list of subscriptions") + @Operation(summary = "Return the list of subscriptions") @GetMapping("") public Iterable listSubscriptions() { return subscriptionRepo.findAll(); } - @ApiOperation("Return a subscription by ID") + @Operation(summary = "Return a subscription by ID") @GetMapping("/{id}") public Subscription getSubscription(@PathVariable final String id) { return subscriptionRepo.findById(id).get(); } - @ApiOperation("Delete a subscription by ID and its notifications") + @Operation(summary = "Delete a subscription by ID and its notifications") @DeleteMapping("/{id}") public void deleteSubscription(@PathVariable final String id) { subscriptionRepo.deleteById(id); notificationRepo.deleteBySubscriptionId(id); } - @ApiOperation("Perform a new subscription") + @Operation(summary = "Perform a new subscription") @PostMapping("") public Subscription registerSubscription(@RequestBody final InSubscription inSub) { final Subscription sub = inSub.asSubscription(); @@ -80,7 +80,7 @@ public class SubscriptionsController extends AbstractDnetController { return sub; } - @ApiOperation("Delete all subscriptions and notifications") + @Operation(summary = "Delete all subscriptions and notifications") @DeleteMapping("") public Map clearSubscriptions() { final Map res = new HashMap<>(); @@ -90,7 +90,7 @@ public class SubscriptionsController extends AbstractDnetController { return res; } - @ApiOperation("Reset the last notification date") + @Operation(summary = "Reset the last notification date") @DeleteMapping("/{id}/date") public void deleteNotificationDate(@PathVariable final String id) { final Subscription s = subscriptionRepo.findById(id).get(); @@ -98,7 +98,7 @@ public class SubscriptionsController extends AbstractDnetController { subscriptionRepo.save(s); } - @ApiOperation("Reset all the last notification dates") + @Operation(summary = "Reset all the last notification dates") @GetMapping("/resetLastNotificationDates") public void deleteAllNotificationDates() { for (final Subscription s : subscriptionRepo.findAll()) { diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/TopicsController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/TopicsController.java index 6ab5d836..3b438ca9 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/TopicsController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/controllers/TopicsController.java @@ -22,12 +22,12 @@ import eu.dnetlib.broker.LiteratureBrokerServiceApplication; import eu.dnetlib.broker.common.topics.TopicType; import eu.dnetlib.broker.common.topics.TopicTypeRepository; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @RestController @RequestMapping("/api/topic-types") -@Api(tags = LiteratureBrokerServiceApplication.TAG_TOPIC_TYPES) +@Tag(name = LiteratureBrokerServiceApplication.TAG_TOPIC_TYPES) public class TopicsController extends AbstractDnetController { @Autowired @@ -36,13 +36,13 @@ public class TopicsController extends AbstractDnetController { private final Predicate verifyExpression = Pattern.compile("^([a-zA-Z0-9._-]+|<[a-zA-Z0-9._-]+>)(\\/([a-zA-Z0-9._-]+|<[a-zA-Z0-9._-]+>))+$").asPredicate(); - @ApiOperation("Return the list of topic types") + @Operation(summary = "Return the list of topic types") @GetMapping("") public Iterable listTopicTypes() { return topicTypeRepo.findAll(); } - @ApiOperation("Register a new topic type") + @Operation(summary = "Register a new topic type") @PostMapping("/add") public TopicType registerTopicType(@RequestParam final String name, @RequestParam final String expression, @@ -61,20 +61,20 @@ public class TopicsController extends AbstractDnetController { return type; } - @ApiOperation("Return a topic type by ID") + @Operation(summary = "Return a topic type by ID") @GetMapping("/{id}") public TopicType getTopicType(@PathVariable final String id) { return topicTypeRepo.findById(id).get(); } - @ApiOperation("Delete a topic type by ID") + @Operation(summary = "Delete a topic type by ID") @DeleteMapping("/{id}") public List deleteTopicType(@PathVariable final String id) { topicTypeRepo.deleteById(id); return Arrays.asList("Done."); } - @ApiOperation("Delete all topic types") + @Operation(summary = "Delete all topic types") @DeleteMapping("") public Map clearTopicTypes() { final Map res = new HashMap<>(); diff --git a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/openaire/OpenaireBrokerController.java b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/openaire/OpenaireBrokerController.java index 16490ef7..54f8e725 100644 --- a/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/openaire/OpenaireBrokerController.java +++ b/apps/dhp-broker-application/src/main/java/eu/dnetlib/broker/openaire/OpenaireBrokerController.java @@ -56,13 +56,13 @@ import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository; import eu.dnetlib.broker.events.output.DispatcherManager; import eu.dnetlib.broker.objects.OaBrokerEventPayload; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @Profile("openaire") @RestController @RequestMapping("/api/openaireBroker") -@Api(tags = LiteratureBrokerServiceApplication.TAG_OPENAIRE) +@Tag(name = LiteratureBrokerServiceApplication.TAG_OPENAIRE) public class OpenaireBrokerController extends AbstractDnetController { @Autowired @@ -85,7 +85,7 @@ public class OpenaireBrokerController extends AbstractDnetController { private static final Log log = LogFactory.getLog(OpenaireBrokerController.class); - @ApiOperation("Return the datasources having events") + @Operation(summary = "Return the datasources having events") @GetMapping("/datasources") public List findDatasourcesWithEvents(@RequestParam(defaultValue = "false", required = false) final boolean useIndex) { return useIndex ? findDatasourcesWithEventsUsingIndex() : findDatasourcesWithEventsUsingDb(); @@ -123,7 +123,7 @@ public class OpenaireBrokerController extends AbstractDnetController { } } - @ApiOperation("Return the topics of the events of a datasource") + @Operation(summary = "Return the topics of the events of a datasource") @GetMapping("/topicsForDatasource") public List findTopicsForDatasource(@RequestParam final String ds, @RequestParam(defaultValue = "false", required = false) final boolean useIndex) { @@ -163,7 +163,7 @@ public class OpenaireBrokerController extends AbstractDnetController { } } - @ApiOperation("Return a page of events of a datasource (by topic)") + @Operation(summary = "Return a page of events of a datasource (by topic)") @GetMapping("/events/{nPage}/{size}") public EventsPage showEvents(@RequestParam final String ds, @RequestParam final String topic, @PathVariable final int nPage, @PathVariable final int size) { @@ -191,7 +191,7 @@ public class OpenaireBrokerController extends AbstractDnetController { return new EventsPage(ds, topic, nPage, overrideGetTotalPage(page, size), page.getTotalHits(), list); } - @ApiOperation("Return a page of events of a datasource (by query)") + @Operation(summary = "Return a page of events of a datasource (by query)") @PostMapping("/events/{nPage}/{size}") public EventsPage advancedShowEvents(@PathVariable final int nPage, @PathVariable final int size, @RequestBody final AdvQueryObject qObj) { @@ -227,7 +227,7 @@ public class OpenaireBrokerController extends AbstractDnetController { return new EventsPage(qObj.getDatasource(), qObj.getTopic(), nPage, overrideGetTotalPage(page, size), page.getTotalHits(), list); } - @ApiOperation("Perform a subscription") + @Operation(summary = "Perform a subscription") @PostMapping("/subscribe") public Subscription registerSubscription(@RequestBody final OpenaireSubscription oSub) { final Subscription sub = oSub.asSubscription(); @@ -237,7 +237,7 @@ public class OpenaireBrokerController extends AbstractDnetController { return sub; } - @ApiOperation("Return the subscriptions of an user (by email and datasource (optional))") + @Operation(summary = "Return the subscriptions of an user (by email and datasource (optional))") @GetMapping("/subscriptions") public Map> subscriptions(@RequestParam final String email, @RequestParam(required = false) final String ds) { final Iterable iter = subscriptionRepo.findBySubscriber(email); @@ -247,7 +247,7 @@ public class OpenaireBrokerController extends AbstractDnetController { .collect(Collectors.groupingBy(SimpleSubscriptionDesc::getDatasource)); } - @ApiOperation("Return a page of notifications") + @Operation(summary = "Return a page of notifications") @GetMapping("/notifications/{subscrId}/{nPage}/{size}") public EventsPage notifications(@PathVariable final String subscrId, @PathVariable final int nPage, @PathVariable final int size) { @@ -279,14 +279,14 @@ public class OpenaireBrokerController extends AbstractDnetController { } - @ApiOperation("Send notifications") + @Operation(summary = "Send notifications") @GetMapping("/notifications/send/{date}") private List sendMailForNotifications(@PathVariable final long date) { new Thread(() -> innerSendMailForNotifications(date)).start(); return Arrays.asList("Sending ..."); } - @ApiOperation("Update stats") + @Operation(summary = "Update stats") @GetMapping("/stats/update") private List updateStats() { new Thread(() -> { diff --git a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerConfiguration.java b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerConfiguration.java index b4721971..01993c09 100644 --- a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerConfiguration.java +++ b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerConfiguration.java @@ -16,10 +16,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import eu.dnetlib.broker.common.elasticsearch.Event; import eu.dnetlib.broker.common.elasticsearch.Notification; import eu.dnetlib.broker.common.properties.ElasticSearchProperties; -import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration -@EnableSwagger2 @EnableCaching @EnableScheduling @EnableTransactionManagement diff --git a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerPublicApplication.java b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerPublicApplication.java index 2093ec7c..01cab66f 100644 --- a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerPublicApplication.java +++ b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/BrokerPublicApplication.java @@ -1,14 +1,19 @@ package eu.dnetlib.broker; +import java.util.ArrayList; +import java.util.List; + +import org.springdoc.core.GroupedOpenApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; import eu.dnetlib.common.app.AbstractDnetApp; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Tag; -import springfox.documentation.spring.web.plugins.Docket; +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.tags.Tag; @SpringBootApplication public class BrokerPublicApplication extends AbstractDnetApp { @@ -19,22 +24,27 @@ public class BrokerPublicApplication extends AbstractDnetApp { SpringApplication.run(BrokerPublicApplication.class, args); } - @Override - protected void configSwagger(final Docket docket) { - - docket.select() - .apis(RequestHandlerSelectors.any()) - .paths(p -> p.startsWith("/")) - .build() - .tags(new Tag(OA_PUBLIC_APIS, OA_PUBLIC_APIS)) - .apiInfo(new ApiInfoBuilder() - .title("OpenAIRE Public Broker API") - .description("APIs documentation") - .version("1.1") - .contact(ApiInfo.DEFAULT_CONTACT) - .license("Apache 2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0") - .build()); - + @Bean + public GroupedOpenApi publicApi() { + return GroupedOpenApi.builder() + .group("Broker Public APIs") + .pathsToMatch("/") + .build(); } + + @Override + protected void configSwagger(final OpenAPI openApi) { + final List tags = new ArrayList<>(); + tags.add(new Tag().name(OA_PUBLIC_APIS).description(OA_PUBLIC_APIS)); + + openApi.info(new Info().title("OpenAIRE Public Broker API") + .description("APIs documentation") + .version("1.1") + .license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0"))) + .externalDocs(new ExternalDocumentation() + .description("SpringShop Wiki Documentation") + .url("https://springshop.wiki.github.org/docs")) + .tags(tags); + } + } diff --git a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/oa/controllers/OpenairePublicController.java b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/oa/controllers/OpenairePublicController.java index c5ad736e..18184d5a 100644 --- a/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/oa/controllers/OpenairePublicController.java +++ b/apps/dhp-broker-public-application/src/main/java/eu/dnetlib/broker/oa/controllers/OpenairePublicController.java @@ -63,13 +63,13 @@ import eu.dnetlib.broker.common.subscriptions.Subscription; import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository; import eu.dnetlib.broker.objects.OaBrokerEventPayload; import eu.dnetlib.common.controller.AbstractDnetController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; @Profile("openaire") @RestController @RequestMapping("/") -@Api(tags = BrokerPublicApplication.OA_PUBLIC_APIS) +@Tag(name = BrokerPublicApplication.OA_PUBLIC_APIS) public class OpenairePublicController extends AbstractDnetController { @Autowired @@ -97,7 +97,7 @@ public class OpenairePublicController extends AbstractDnetController { private static final Log log = LogFactory.getLog(OpenairePublicController.class); - @ApiOperation("Returns notifications by subscription using scrolls (first page)") + @Operation(summary = "Returns notifications by subscription using scrolls (first page)") @GetMapping("/scroll/notifications/bySubscriptionId/{subscrId}") public ScrollPage prepareScrollNotificationsBySubscrId(@PathVariable final String subscrId) { @@ -130,7 +130,7 @@ public class OpenairePublicController extends AbstractDnetController { } } - @ApiOperation("Returns notifications using scrolls (other pages)") + @Operation(summary = "Returns notifications using scrolls (other pages)") @GetMapping("/scroll/notifications/{scrollId}") public ScrollPage scrollNotifications(@PathVariable final String scrollId) { @@ -147,7 +147,7 @@ public class OpenairePublicController extends AbstractDnetController { } } - @ApiOperation("Returns notifications as file") + @Operation(summary = "Returns notifications as file") @GetMapping(value = "/file/notifications/bySubscriptionId/{subscrId}", produces = "application/gzip") public void notificationsAsFile(final HttpServletResponse res, @PathVariable final String subscrId) throws Exception { @@ -184,7 +184,7 @@ public class OpenairePublicController extends AbstractDnetController { } - @ApiOperation("Returns events as file by opendoarId") + @Operation(summary = "Returns events as file by opendoarId") @GetMapping(value = "/file/events/opendoar/{id}", produces = "application/gzip") public void opendoarEventsAsFile(final HttpServletResponse res, @PathVariable final String id) { @@ -252,13 +252,13 @@ public class OpenairePublicController extends AbstractDnetController { return first; } - @ApiOperation("Returns the list of subscriptions by user email") + @Operation(summary = "Returns the list of subscriptions by user email") @GetMapping(value = "/subscriptions") private Iterable listSubscriptionsByUser(@RequestParam final String email) { return subscriptionRepo.findBySubscriber(email); } - @ApiOperation("Returns the status of the application") + @Operation(summary = "Returns the status of the application") @GetMapping(value = "/status") private Map status() { final Map res = new LinkedHashMap<>(); @@ -269,7 +269,7 @@ public class OpenairePublicController extends AbstractDnetController { return res; } - @ApiOperation("Store the feedback of an event (MOCK)") + @Operation(summary = "Store the feedback of an event (MOCK)") @RequestMapping(value = "/feedback/events", method = { RequestMethod.POST, RequestMethod.PATCH }) diff --git a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/MainApplication.java b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/MainApplication.java index 56a3d48d..9d2592fd 100644 --- a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/MainApplication.java +++ b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/MainApplication.java @@ -8,11 +8,11 @@ import org.springframework.cache.annotation.EnableCaching; import org.springframework.scheduling.annotation.EnableScheduling; import eu.dnetlib.common.app.AbstractDnetApp; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; + + + + + @SpringBootApplication @EnableSwagger2 diff --git a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/controller/MDStoreController.java b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/controller/MDStoreController.java index bf5ee22f..99246664 100644 --- a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/controller/MDStoreController.java +++ b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/controller/MDStoreController.java @@ -29,7 +29,7 @@ import io.swagger.annotations.ApiParam; @RestController @RequestMapping("/mdstores") -@Api(tags = { +@Tag(tags = { "Metadata Stores" }) public class MDStoreController extends AbstractDnetController { @@ -42,67 +42,67 @@ public class MDStoreController extends AbstractDnetController { private static final Logger log = LoggerFactory.getLogger(DatabaseUtils.class); - @ApiOperation("Return all the mdstores") + @Operation(summary = "Return all the mdstores") @GetMapping("/") public Iterable find() { return databaseUtils.listMdStores(); } - @ApiOperation("Return all the mdstore identifiers") + @Operation(summary = "Return all the mdstore identifiers") @GetMapping("/ids") public List findIdentifiers() { return databaseUtils.listMdStoreIDs(); } - @ApiOperation("Return a mdstores by id") + @Operation(summary = "Return a mdstores by id") @GetMapping("/mdstore/{mdId}") - public MDStoreWithInfo getMdStore(@ApiParam("the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException { + public MDStoreWithInfo getMdStore(@Parameter("the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException { return databaseUtils.findMdStore(mdId); } - @ApiOperation("Increase the read count of the current mdstore") + @Operation(summary = "Increase the read count of the current mdstore") @GetMapping("/mdstore/{mdId}/startReading") - public MDStoreVersion startReading(@ApiParam("the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException { + public MDStoreVersion startReading(@Parameter("the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException { return databaseUtils.startReading(mdId); } - @ApiOperation("Create a new mdstore") + @Operation(summary = "Create a new mdstore") @GetMapping("/new/{format}/{layout}/{interpretation}") public MDStoreWithInfo createMDStore( - @ApiParam("mdstore format") @PathVariable final String format, - @ApiParam("mdstore layout") @PathVariable final String layout, - @ApiParam("mdstore interpretation") @PathVariable final String interpretation, - @ApiParam("datasource name") @RequestParam(required = true) final String dsName, - @ApiParam("datasource id") @RequestParam(required = true) final String dsId, - @ApiParam("api id") @RequestParam(required = true) final String apiId) throws MDStoreManagerException { + @Parameter("mdstore format") @PathVariable final String format, + @Parameter("mdstore layout") @PathVariable final String layout, + @Parameter("mdstore interpretation") @PathVariable final String interpretation, + @Parameter("datasource name") @RequestParam(required = true) final String dsName, + @Parameter("datasource id") @RequestParam(required = true) final String dsId, + @Parameter("api id") @RequestParam(required = true) final String apiId) throws MDStoreManagerException { final String id = databaseUtils.createMDStore(format, layout, interpretation, dsName, dsId, apiId); return databaseUtils.findMdStore(id); } - @ApiOperation("Delete a mdstore by id") + @Operation(summary = "Delete a mdstore by id") @DeleteMapping("/mdstore/{mdId}") - public StatusResponse delete(@ApiParam("the id of the mdstore that will be deleted") @PathVariable final String mdId) throws MDStoreManagerException { + public StatusResponse delete(@Parameter("the id of the mdstore that will be deleted") @PathVariable final String mdId) throws MDStoreManagerException { final String hdfsPath = databaseUtils.deleteMdStore(mdId); hdfsClient.deletePath(hdfsPath); return StatusResponse.DELETED; } - @ApiOperation("Return all the versions of a mdstore") + @Operation(summary = "Return all the versions of a mdstore") @GetMapping("/mdstore/{mdId}/versions") public Iterable listVersions(@PathVariable final String mdId) throws MDStoreManagerException { return databaseUtils.listVersions(mdId); } - @ApiOperation("Create a new preliminary version of a mdstore") + @Operation(summary = "Create a new preliminary version of a mdstore") @GetMapping("/mdstore/{mdId}/newVersion") - public MDStoreVersion prepareNewVersion(@ApiParam("the id of the mdstore for which will be created a new version") @PathVariable final String mdId) { + public MDStoreVersion prepareNewVersion(@Parameter("the id of the mdstore for which will be created a new version") @PathVariable final String mdId) { return databaseUtils.prepareMdStoreVersion(mdId); } - @ApiOperation("Promote a preliminary version to current") + @Operation(summary = "Promote a preliminary version to current") @GetMapping("/version/{versionId}/commit/{size}") - public MDStoreVersion commitVersion(@ApiParam("the id of the version that will be promoted to the current version") @PathVariable final String versionId, - @ApiParam("the size of the new current mdstore") @PathVariable final long size) throws MDStoreManagerException { + public MDStoreVersion commitVersion(@Parameter("the id of the version that will be promoted to the current version") @PathVariable final String versionId, + @Parameter("the size of the new current mdstore") @PathVariable final long size) throws MDStoreManagerException { try { return databaseUtils.commitMdStoreVersion(versionId, size); } finally { @@ -110,46 +110,46 @@ public class MDStoreController extends AbstractDnetController { } } - @ApiOperation("Abort a preliminary version") + @Operation(summary = "Abort a preliminary version") @GetMapping("/version/{versionId}/abort") - public StatusResponse commitVersion(@ApiParam("the id of the version to abort") @PathVariable final String versionId) throws MDStoreManagerException { + public StatusResponse commitVersion(@Parameter("the id of the version to abort") @PathVariable final String versionId) throws MDStoreManagerException { final String hdfsPath = databaseUtils.deleteMdStoreVersion(versionId, true); hdfsClient.deletePath(hdfsPath); return StatusResponse.ABORTED; } - @ApiOperation("Return an existing mdstore version") + @Operation(summary = "Return an existing mdstore version") @GetMapping("/version/{versionId}") - public MDStoreVersion getVersion(@ApiParam("the id of the version that has to be deleted") @PathVariable final String versionId) + public MDStoreVersion getVersion(@Parameter("the id of the version that has to be deleted") @PathVariable final String versionId) throws MDStoreManagerException { return databaseUtils.findVersion(versionId); } - @ApiOperation("Delete a mdstore version") + @Operation(summary = "Delete a mdstore version") @DeleteMapping("/version/{versionId}") - public StatusResponse deleteVersion(@ApiParam("the id of the version that has to be deleted") @PathVariable final String versionId, - @ApiParam("if true, the controls on writing and readcount values will be skipped") @RequestParam(required = false, defaultValue = "false") final boolean force) + public StatusResponse deleteVersion(@Parameter("the id of the version that has to be deleted") @PathVariable final String versionId, + @Parameter("if true, the controls on writing and readcount values will be skipped") @RequestParam(required = false, defaultValue = "false") final boolean force) throws MDStoreManagerException { final String hdfsPath = databaseUtils.deleteMdStoreVersion(versionId, force); hdfsClient.deletePath(hdfsPath); return StatusResponse.DELETED; } - @ApiOperation("Decrease the read count of a mdstore version") + @Operation(summary = "Decrease the read count of a mdstore version") @GetMapping("/version/{versionId}/endReading") - public MDStoreVersion endReading(@ApiParam("the id of the version that has been completely read") @PathVariable final String versionId) + public MDStoreVersion endReading(@Parameter("the id of the version that has been completely read") @PathVariable final String versionId) throws MDStoreManagerException { return databaseUtils.endReading(versionId); } - @ApiOperation("Reset the read count of a mdstore version") + @Operation(summary = "Reset the read count of a mdstore version") @GetMapping("/version/{versionId}/resetReading") - public MDStoreVersion resetReading(@ApiParam("the id of the version") @PathVariable final String versionId) + public MDStoreVersion resetReading(@Parameter("the id of the version") @PathVariable final String versionId) throws MDStoreManagerException { return databaseUtils.resetReading(versionId); } - @ApiOperation("Delete expired versions") + @Operation(summary = "Delete expired versions") @DeleteMapping("/versions/expired") public StatusResponse deleteExpiredVersions() { new Thread(this::performDeleteOfExpiredVersions).start(); @@ -169,10 +169,10 @@ public class MDStoreController extends AbstractDnetController { log.info("Done."); } - @ApiOperation("Fix the inconsistencies on HDFS") + @Operation(summary = "Fix the inconsistencies on HDFS") @GetMapping("/hdfs/inconsistencies") public Set fixHdfsInconsistencies( - @ApiParam("force the deletion of hdfs paths") @RequestParam(required = false, defaultValue = "false") final boolean delete) + @Parameter("force the deletion of hdfs paths") @RequestParam(required = false, defaultValue = "false") final boolean delete) throws MDStoreManagerException { final Set hdfsDirs = hdfsClient.listHadoopDirs(); @@ -189,7 +189,7 @@ public class MDStoreController extends AbstractDnetController { return toDelete; } - @ApiOperation("Show informations") + @Operation(summary = "Show informations") @GetMapping("/info") public Map info() { final Map info = new LinkedHashMap<>(); @@ -201,21 +201,21 @@ public class MDStoreController extends AbstractDnetController { return info; } - @ApiOperation("list the file inside the path of a mdstore version") + @Operation(summary = "list the file inside the path of a mdstore version") @GetMapping("/version/{versionId}/parquet/files") public Set listVersionFiles(@PathVariable final String versionId) throws MDStoreManagerException { final String path = databaseUtils.findVersion(versionId).getHdfsPath(); return hdfsClient.listContent(path + "/store", HdfsClient::isParquetFile); } - @ApiOperation("read the parquet file of a mdstore version") + @Operation(summary = "read the parquet file of a mdstore version") @GetMapping("/version/{versionId}/parquet/content/{limit}") public List> listVersionParquet(@PathVariable final String versionId, @PathVariable final long limit) throws MDStoreManagerException { final String path = databaseUtils.findVersion(versionId).getHdfsPath(); return hdfsClient.readParquetFiles(path + "/store", limit); } - @ApiOperation("read the parquet file of a mdstore (current version)") + @Operation(summary = "read the parquet file of a mdstore (current version)") @GetMapping("/mdstore/{mdId}/parquet/content/{limit}") public List> listMdstoreParquet(@PathVariable final String mdId, @PathVariable final long limit) throws MDStoreManagerException { final String versionId = databaseUtils.findMdStore(mdId).getCurrentVersion(); diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/DNetOpenaireExporterApplication.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/DNetOpenaireExporterApplication.java index 8af6272c..03c8ed92 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/DNetOpenaireExporterApplication.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/DNetOpenaireExporterApplication.java @@ -21,12 +21,12 @@ import eu.dnetlib.openaire.dsm.DsmApiController; import eu.dnetlib.openaire.funders.FundersApiController; import eu.dnetlib.openaire.info.InfoController; import eu.dnetlib.openaire.project.ProjectsController; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; + + + + + + @EnableCaching @EnableScheduling diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java index e653b09a..d63deda7 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java @@ -22,41 +22,41 @@ public class CommunityApiController { @RequestMapping(value = "/community/communities", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get all community profiles", notes = "get all community profiles", tags = { C, R }, response = CommunitySummary[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunitySummary[].class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunitySummary[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public List listCommunities() throws CommunityException { return communityApiCore.listCommunities(); } @RequestMapping(value = "/community/{id}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get community profile", notes = "get community profile", tags = { C, R }, response = CommunityDetails.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunityDetails.class), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunityDetails.class), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityDetails getCommunity(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { return communityApiCore.getCommunity(id); } @RequestMapping(value = "/community/{id}", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "update community details", notes = "update community details", tags = { C, R }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public void setCommunity( @PathVariable final String id, @RequestBody CommunityWritableProperties properties) throws CommunityException, CommunityNotFoundException { @@ -65,28 +65,28 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/projects", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get community projects", notes = "get community projects", tags = { C_PJ, R }, response = CommunityProject[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunityProject[].class), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunityProject[].class), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public List getCommunityProjects(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { return communityApiCore.getCommunityProjects(id); } @RequestMapping(value = "/community/{id}/projects", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "associate a project to the community", notes = "associate a project to the community", tags = { C_PJ, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityProject addCommunityProject( @PathVariable final String id, @RequestBody final CommunityProject project) throws CommunityException, CommunityNotFoundException { @@ -95,14 +95,14 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/projects", produces = { "application/json" }, method = RequestMethod.DELETE) - @ApiOperation( + @Operation( value = "remove a project from the community", notes = "remove a project from the community", tags = { C_PJ, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public void deleteCommunityProject( @PathVariable final String id, @RequestBody final Integer projectId) throws CommunityException, CommunityNotFoundException { @@ -111,28 +111,28 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/contentproviders", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get the list of content providers associated to a given community", notes = "get the list of content providers associated to a given community", tags = { C_CP, R }, response = CommunityContentprovider[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunityContentprovider[].class), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunityContentprovider[].class), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public List getCommunityContentproviders(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { return communityApiCore.getCommunityContentproviders(id); } @RequestMapping(value = "/community/{id}/contentproviders", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "associate a content provider to the community", notes = "associate a content provider to the community", tags = { C_CP, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityContentprovider addCommunityContentprovider( @PathVariable final String id, @RequestBody final CommunityContentprovider contentprovider) throws CommunityException, CommunityNotFoundException { @@ -141,14 +141,14 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/contentproviders", produces = { "application/json" }, method = RequestMethod.DELETE) - @ApiOperation( + @Operation( value = "remove the association between a content provider and the community", notes = "remove the association between a content provider and the community", tags = { C_CP, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public void removeCommunityContentprovider( @PathVariable final String id, @RequestBody final Integer contentproviderId) throws CommunityException, CommunityNotFoundException { @@ -159,28 +159,28 @@ public class CommunityApiController { //ADDING CODE FOR COMMUNITY ORGANIZATIONS @RequestMapping(value = "/community/{id}/organizations", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get the list of organizations for a given community", notes = "get the list of organizations for a given community", tags = { C_O, R }, response = CommunityOrganization[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunityContentprovider[].class), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunityContentprovider[].class), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public List getCommunityOrganizations(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { return communityApiCore.getCommunityOrganizations(id); } @RequestMapping(value = "/community/{id}/organizations", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "associate an organization to the community", notes = "associate an organization to the community", tags = { C_O, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityOrganization addCommunityOrganization( @PathVariable final String id, @RequestBody final CommunityOrganization organization) throws CommunityException, CommunityNotFoundException { @@ -189,14 +189,14 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/organizations", produces = { "application/json" }, method = RequestMethod.DELETE) - @ApiOperation( + @Operation( value = "remove the association between an organization and the community", notes = "remove the association between an organization and the community", tags = { C_O, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public void removeCommunityOrganization( @PathVariable final String id, @RequestBody final Integer organizationId) throws CommunityException, CommunityNotFoundException { @@ -206,14 +206,14 @@ public class CommunityApiController { //********************** @RequestMapping(value = "/community/{id}/subjects", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "associate a subject to the community", notes = "associate a subject to the community", tags = { C, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityDetails addCommunitySubjects( @PathVariable final String id, @RequestBody final List subjects) throws CommunityException, CommunityNotFoundException { @@ -222,14 +222,14 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/subjects", produces = { "application/json" }, method = RequestMethod.DELETE) - @ApiOperation( + @Operation( value = "remove subjects from a community", notes = "remove subjects from a community", tags = { C, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityDetails removeCommunitySubjects( @PathVariable final String id, @RequestBody final List subjects) throws CommunityException, CommunityNotFoundException { @@ -238,28 +238,28 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get the list of Zenodo communities associated to a given community", notes = "get the list of Zenodo communities associated to a given community", tags = { C_ZC, R }, response = CommunityZenodoCommunity[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CommunityZenodoCommunity[].class), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CommunityZenodoCommunity[].class), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public List getCommunityZenodoCommunities(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { return communityApiCore.getCommunityZenodoCommunities(id); } @RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation( + @Operation( value = "associate a Zenodo community to the community", notes = "associate a Zenodo community to the community", tags = { C_ZC, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityZenodoCommunity addCommunityZenodoCommunity( @PathVariable final String id, @RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, CommunityNotFoundException { @@ -269,14 +269,14 @@ public class CommunityApiController { } @RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.DELETE) - @ApiOperation( + @Operation( value = "remove a Zenodo community from a community", notes = "remove a Zenodo community from a community", tags = { C_ZC, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public void removeCommunityZenodoCommunity( @PathVariable final String id, @RequestBody final Integer zenodoCommId) throws CommunityException, CommunityNotFoundException { @@ -287,14 +287,14 @@ public class CommunityApiController { @RequestMapping(value = "/community/{zenodoId}/openairecommunities", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get the list of OpenAIRE communities associated to a given Zenodo community", notes = "get the list of OpenAIRE communities associated to a given Zenodo community", tags = { C_ZC, R }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), - @ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found", response = CommunityNotFoundException.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = CommunityException.class) }) public CommunityOpenAIRECommunities getOpenAireCommunities( @PathVariable final String zenodoId) throws CommunityException, CommunityNotFoundException { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityContentprovider.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityContentprovider.java index 334a3db1..4520c952 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityContentprovider.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityContentprovider.java @@ -11,26 +11,26 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public class CommunityContentprovider { - @ApiModelProperty(value = "OpenAIRE identifier for this content provider, if available", required = false) + @Schema(value = "OpenAIRE identifier for this content provider, if available", required = false) private String openaireId; @NotNull - @ApiModelProperty(value = "the community identifier this content provider belongs to", required = true) + @Schema(value = "the community identifier this content provider belongs to", required = true) private String communityId; @NotNull - @ApiModelProperty(value = "identifies this content provider within the context it belongs to", required = true) + @Schema(value = "identifies this content provider within the context it belongs to", required = true) private String id; - @ApiModelProperty(value = "content provider name", required = false) + @Schema(value = "content provider name", required = false) private String name; @NotNull - @ApiModelProperty(value = "content provider official name", required = true) + @Schema(value = "content provider official name", required = true) private String officialname; // @NotNull - @ApiModelProperty(value = "content provider selection criteria", required = false) + @Schema(value = "content provider selection criteria", required = false) private SelectionCriteria selectioncriteria; public String getOpenaireId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityDetails.java index 5d315dd7..9d1253e0 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityDetails.java @@ -9,13 +9,13 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public class CommunityDetails extends CommunitySummary { - @ApiModelProperty("date of creation for this community") + @Schema("date of creation for this community") private Date creationDate; - @ApiModelProperty("date of the last update for this communityu") + @Schema("date of the last update for this communityu") private Date lastUpdateDate; - @ApiModelProperty("list of subjects (keywords) that characterise this community") + @Schema("list of subjects (keywords) that characterise this community") private List subjects; public CommunityDetails() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOpenAIRECommunities.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOpenAIRECommunities.java index 3cf3403f..8af72846 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOpenAIRECommunities.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOpenAIRECommunities.java @@ -9,11 +9,11 @@ import java.util.List; public class CommunityOpenAIRECommunities { @NotNull - @ApiModelProperty(value = "the zenodo community identifier", required = true) + @Schema(value = "the zenodo community identifier", required = true) private String zenodoid; @NotNull - @ApiModelProperty(value = "identifies this zenodo community within the context it belongs to", required = true) + @Schema(value = "identifies this zenodo community within the context it belongs to", required = true) private List openAirecommunitylist; public CommunityOpenAIRECommunities() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOrganization.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOrganization.java index 7ced9784..6a7b04a6 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOrganization.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityOrganization.java @@ -8,24 +8,24 @@ import javax.validation.constraints.NotNull; @JsonAutoDetect public class CommunityOrganization { @NotNull - @ApiModelProperty(value = "the community identifier this organization belongs to", required = true) + @Schema(value = "the community identifier this organization belongs to", required = true) private String communityId; @NotNull - @ApiModelProperty(value = "name of the organization", required = true) + @Schema(value = "name of the organization", required = true) private String name; @NotNull - @ApiModelProperty(value = "identifies this organization within the context it belongs to", required = true) + @Schema(value = "identifies this organization within the context it belongs to", required = true) private String id; @NotNull - @ApiModelProperty(value="url of the logo for this organization", required = true) + @Schema(value="url of the logo for this organization", required = true) private String logo_url; @NotNull - @ApiModelProperty(value="website url for this organization", required = true) + @Schema(value="website url for this organization", required = true) private String website_url; public String getCommunityId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityProject.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityProject.java index 205e844a..f5759357 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityProject.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityProject.java @@ -6,25 +6,25 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public class CommunityProject { - @ApiModelProperty(value = "OpenAIRE identifier for this project, if available", required = false) + @Schema(value = "OpenAIRE identifier for this project, if available", required = false) private String openaireId; - @ApiModelProperty(value = "the community identifier this project belongs to", required = true) + @Schema(value = "the community identifier this project belongs to", required = true) private String communityId; - @ApiModelProperty(value = "identifies this project within the context it belongs to", required = true) + @Schema(value = "identifies this project within the context it belongs to", required = true) private String id; - @ApiModelProperty(value = "project name", required = true) + @Schema(value = "project name", required = true) private String name; - @ApiModelProperty(value = "project acronym", required = false) + @Schema(value = "project acronym", required = false) private String acronym; - @ApiModelProperty(value = "project funder", required = true) + @Schema(value = "project funder", required = true) private String funder; - @ApiModelProperty(value = "project grant id", required = true) + @Schema(value = "project grant id", required = true) private String grantId; public String getOpenaireId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityStatus.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityStatus.java index e3b4902a..a3410979 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityStatus.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityStatus.java @@ -6,12 +6,12 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public enum CommunityStatus { - @ApiModelProperty("restricted visibility") + @Schema("restricted visibility") hidden, - @ApiModelProperty("visible only to RCD managers") + @Schema("visible only to RCD managers") manager, - @ApiModelProperty("visible to RCD managers and to the community users") + @Schema("visible to RCD managers and to the community users") all } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunitySummary.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunitySummary.java index e504583e..7da79b37 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunitySummary.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunitySummary.java @@ -9,37 +9,37 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public class CommunitySummary { - @ApiModelProperty("identifies the community") + @Schema("identifies the community") protected String id; - @ApiModelProperty("values for this field reflect the index field _community_ in the index, e.g. 'egi||EGI Federation'") + @Schema("values for this field reflect the index field _community_ in the index, e.g. 'egi||EGI Federation'") protected String queryId; - @ApiModelProperty("community type") + @Schema("community type") protected String type; - @ApiModelProperty("community name") + @Schema("community name") protected String name; - @ApiModelProperty("community short name") + @Schema("community short name") protected String shortName; - @ApiModelProperty("community creation date") + @Schema("community creation date") protected Date creationDate; - @ApiModelProperty("community last update date") + @Schema("community last update date") protected Date lastUpdateDate; - @ApiModelProperty("community description") + @Schema("community description") protected String description; - @ApiModelProperty("http url for the community logo") + @Schema("http url for the community logo") protected String logoUrl; - @ApiModelProperty("status of the community, drives its visibility") + @Schema("status of the community, drives its visibility") protected CommunityStatus status; - @ApiModelProperty("Zenodo community associated to this community") + @Schema("Zenodo community associated to this community") protected String zenodoCommunity; public CommunitySummary() {} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityWritableProperties.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityWritableProperties.java index 08ca7a26..726e6aa9 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityWritableProperties.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityWritableProperties.java @@ -8,25 +8,25 @@ import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect public class CommunityWritableProperties { - @ApiModelProperty("community name") + @Schema("community name") private String name; - @ApiModelProperty("community short name") + @Schema("community short name") private String shortName; - @ApiModelProperty("community description") + @Schema("community description") private String description; - @ApiModelProperty("http url for the community logo") + @Schema("http url for the community logo") private String logoUrl; - @ApiModelProperty("list of subjects (keywords) that characterise this community") + @Schema("list of subjects (keywords) that characterise this community") private List subjects; - @ApiModelProperty("status of the community, drives its visibility") + @Schema("status of the community, drives its visibility") private CommunityStatus status; - @ApiModelProperty("id of the main Zenodo community") + @Schema("id of the main Zenodo community") private String mainZenodoCommunity; diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityZenodoCommunity.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityZenodoCommunity.java index c84c1692..0ca8f549 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityZenodoCommunity.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityZenodoCommunity.java @@ -9,15 +9,15 @@ import io.swagger.annotations.ApiModelProperty; public class CommunityZenodoCommunity { @NotNull - @ApiModelProperty(value = "the community identifier this zenodo Community belongs to", required = true) + @Schema(value = "the community identifier this zenodo Community belongs to", required = true) private String communityId; @NotNull - @ApiModelProperty(value = "Zenodo identifier for this community", required = true) + @Schema(value = "Zenodo identifier for this community", required = true) private String zenodoid; @NotNull - @ApiModelProperty(value = "identifies this zenodo community within the context it belongs to", required = true) + @Schema(value = "identifies this zenodo community within the context it belongs to", required = true) private String id; public String getZenodoid() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java index 64aae1fe..7f049781 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java @@ -20,27 +20,27 @@ public class ContextApiController { private ContextApiCore contextApiCore; @RequestMapping(value = "/contexts", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "list brief information about all the context profiles", notes = "list brief information about all the context profiles.", tags = { }, response = ContextSummary[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ContextSummary[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ContextException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = ContextSummary[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ContextException.class) }) public List listContexts(@RequestParam(required = false, defaultValue = "") List type) throws ContextException { return contextApiCore.listContexts(type); } @RequestMapping(value = "/context/{contextId}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "list the categories defined within a context", notes = "list the categories defined within a context", tags = { }, response = CategorySummary[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = CategorySummary[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ContextException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = CategorySummary[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ContextException.class) }) public List listCategories( @PathVariable final String contextId, @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { @@ -50,14 +50,14 @@ public class ContextApiController { } @RequestMapping(value = "/context/category/{categoryId}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "list the concepts defined within a category", notes = "list the concepts defined within a category", tags = { }, response = ConceptSummary[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ConceptSummary[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ContextException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = ConceptSummary[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ContextException.class) }) public List listConcepts( @PathVariable final String categoryId, @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { @@ -67,14 +67,14 @@ public class ContextApiController { } @RequestMapping(value = "/context/category/concept/{conceptId}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "list the concepts defined within a category", notes = "list the concepts defined within a category", tags = { }, response = ConceptSummary[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ConceptSummary[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ContextException.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = ConceptSummary[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ContextException.class) }) public List listSubConcepts( @PathVariable final String conceptId, @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmApiController.java index 5c0451c6..d9ed6dfc 100755 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmApiController.java @@ -61,12 +61,12 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/countries", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "list the datasource countries", notes = "list the datasource countries", tags = { + @Operation(summary = "list the datasource countries", notes = "list the datasource countries", tags = { DS, R }, response = Country[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = Country[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = Country[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public List listCountries() throws DsmException { return dsmCore.listCountries(); @@ -75,12 +75,12 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/searchdetails/{page}/{size}", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation(value = "search datasources", notes = "Returns list of Datasource details.", tags = { + @Operation(summary = "search datasources", notes = "Returns list of Datasource details.", tags = { DS, R }, response = DatasourceDetailResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = DatasourceDetailResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = DatasourceDetailResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public DatasourceDetailResponse searchDsDetails( @RequestParam final RequestSort requestSortBy, @@ -96,12 +96,12 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/aggregationhistory/{dsId}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "search datasources", notes = "Returns list of Datasource details.", tags = { + @Operation(summary = "search datasources", notes = "Returns list of Datasource details.", tags = { DS, R }, response = AggregationHistoryResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = AggregationHistoryResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = AggregationHistoryResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public AggregationHistoryResponse aggregationHistory(@PathVariable final String dsId) throws DsmException { final StopWatch stop = StopWatch.createStarted(); @@ -112,12 +112,12 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/searchsnippet/{page}/{size}", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation(value = "search datasources", notes = "Returns list of Datasource basic info.", tags = { + @Operation(summary = "search datasources", notes = "Returns list of Datasource basic info.", tags = { DS, R }, response = DatasourceSnippetResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = DatasourceSnippetResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = DatasourceSnippetResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public DatasourceSnippetResponse searchSnippet( @RequestParam final RequestSort requestSortBy, @@ -133,13 +133,13 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/searchregistered/{page}/{size}", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation(value = "search among registered datasources", notes = "Returns list of Datasource basic info.", tags = { + @Operation(summary = "search among registered datasources", notes = "Returns list of Datasource basic info.", tags = { DS, R }, response = DatasourceSnippetResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = DatasourceSnippetResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = DatasourceSnippetResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public DatasourceSnippetResponse searchRegistered( @RequestParam final RequestSort requestSortBy, @@ -155,13 +155,13 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/recentregistered/{size}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "return the latest datasources that were registered through Provide", notes = "Returns list of Datasource basic info.", tags = { + @Operation(summary = "return the latest datasources that were registered through Provide", notes = "Returns list of Datasource basic info.", tags = { DS, R }, response = SimpleResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = DatasourceResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = DatasourceResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public SimpleResponse recentRegistered(@PathVariable final int size) throws Throwable { final StopWatch stop = StopWatch.createStarted(); @@ -172,13 +172,13 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/countregistered", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "return the number of datasources registered after the given date", notes = "Returns a number.", tags = { + @Operation(summary = "return the number of datasources registered after the given date", notes = "Returns a number.", tags = { DS, R }, response = Long.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = Long.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = Long.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public Long countRegistered(@RequestParam final String fromDate, @RequestParam(required = false) final String typologyFilter) throws Throwable { @@ -188,13 +188,13 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/ds/api/{dsId}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get the list of API for a given datasource", notes = "Returns the list of API for a given datasource.", tags = { + @Operation(summary = "get the list of API for a given datasource", notes = "Returns the list of API for a given datasource.", tags = { API, R }, response = ApiDetailsResponse.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ApiDetailsResponse.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = ApiDetailsResponse.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public ApiDetailsResponse getApi( @PathVariable final String dsId) throws DsmException { @@ -207,12 +207,12 @@ public class DsmApiController extends AbstractExporterController { @RequestMapping(value = "/api/baseurl/{page}/{size}", produces = { "application/json" }, method = RequestMethod.POST) - @ApiOperation(value = "search for the list of base URLs of Datasource APIs managed by a user", notes = "Returns the list of base URLs of Datasource APIs managed by a user", tags = { + @Operation(summary = "search for the list of base URLs of Datasource APIs managed by a user", notes = "Returns the list of base URLs of Datasource APIs managed by a user", tags = { DS, API, R }, response = String[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = String[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = String[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public List searchBaseUrls( @RequestBody final RequestFilter requestFilter, @@ -223,26 +223,26 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/api/{apiId}", method = RequestMethod.DELETE) - @ApiOperation(value = "delete an API", notes = "delete an API, if removable", tags = { + @Operation(summary = "delete an API", notes = "delete an API, if removable", tags = { API, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 400, message = "Api not found", response = ErrorMessage.class), - @ApiResponse(code = 403, message = "Api not removable", response = ErrorMessage.class), - @ApiResponse(code = 500, message = "DSM Server error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "400", description = "Api not found", response = ErrorMessage.class), + @ApiResponse(responseCode = "403", description = "Api not removable", response = ErrorMessage.class), + @ApiResponse(responseCode = "500", description = "DSM Server error", response = ErrorMessage.class) }) public void deleteApi(@PathVariable final String apiId) throws DsmForbiddenException, DsmNotFoundException { dsmCore.deleteApi(apiId); } @RequestMapping(value = "/ds/manage", method = RequestMethod.POST) - @ApiOperation(value = "set the managed status for a given datasource", notes = "set the managed status for a given datasource", tags = { + @Operation(summary = "set the managed status for a given datasource", notes = "set the managed status for a given datasource", tags = { DS, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void setManaged( @RequestParam final String id, @@ -252,25 +252,25 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/managed/{id}", method = RequestMethod.GET) - @ApiOperation(value = "get the datasource managed status", notes = "get the datasource managed status", tags = { + @Operation(summary = "get the datasource managed status", notes = "get the datasource managed status", tags = { DS, R }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public boolean isManaged(@PathVariable final String id) throws DsmException { return dsmCore.isManaged(id); } @RequestMapping(value = "/ds/add", method = RequestMethod.POST) - @ApiOperation(value = "add a new Datasource", notes = "add a new Datasource", tags = { + @Operation(summary = "add a new Datasource", notes = "add a new Datasource", tags = { DS, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 400, message = "Malformed request", response = ErrorMessage[].class), - @ApiResponse(code = 500, message = "Unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "400", description = "Malformed request", response = ErrorMessage[].class), + @ApiResponse(responseCode = "500", description = "Unexpected error", response = ErrorMessage.class) }) public void saveDs(@Valid @RequestBody final DatasourceDetails datasource) throws DsmException { @@ -281,13 +281,13 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/addWithApis", method = RequestMethod.POST) - @ApiOperation(value = "add a new Datasource and its apis", notes = "add a new Datasource and its apis", tags = { + @Operation(summary = "add a new Datasource and its apis", notes = "add a new Datasource and its apis", tags = { DS, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 400, message = "Malformed request", response = ErrorMessage[].class), - @ApiResponse(code = 500, message = "Unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "400", description = "Malformed request", response = ErrorMessage[].class), + @ApiResponse(responseCode = "500", description = "Unexpected error", response = ErrorMessage.class) }) public void saveDsWithApis(@Valid @RequestBody final DatasourceDetailsWithApis d) throws DsmException { if (d.getDatasource() == null) { throw new DsmException(HttpStatus.SC_BAD_REQUEST, "Datasource field is null"); } @@ -298,12 +298,12 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/update", method = RequestMethod.POST) - @ApiOperation(value = "update Datasource details", notes = "update Datasource details", tags = { + @Operation(summary = "update Datasource details", notes = "update Datasource details", tags = { DS, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void updateDatasource( @RequestBody final DatasourceDetailsUpdate ds) throws DsmException, DsmNotFoundException { @@ -312,12 +312,12 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/api/baseurl", method = RequestMethod.POST) - @ApiOperation(value = "update the base URL of a datasource interface", notes = "update the base URL of a datasource interface", tags = { + @Operation(summary = "update the base URL of a datasource interface", notes = "update the base URL of a datasource interface", tags = { API, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void updateBaseUrl( @RequestParam final String dsId, @@ -328,12 +328,12 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/api/compliance", method = RequestMethod.POST) - @ApiOperation(value = "update the compatibility of a datasource interface", notes = "update the compatibility of a datasource interface", tags = { + @Operation(summary = "update the compatibility of a datasource interface", notes = "update the compatibility of a datasource interface", tags = { API, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void updateCompliance( @RequestParam final String dsId, @@ -345,12 +345,12 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/api/oaiset", method = RequestMethod.POST) - @ApiOperation(value = "update the OAI set of a datasource interface", notes = "update the OAI set of a datasource interface", tags = { + @Operation(summary = "update the OAI set of a datasource interface", notes = "update the OAI set of a datasource interface", tags = { API, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void updateOaiSetl( @RequestParam final String dsId, @@ -361,12 +361,12 @@ public class DsmApiController extends AbstractExporterController { } @RequestMapping(value = "/ds/api/add", method = RequestMethod.POST) - @ApiOperation(value = "adds a new Interface to one Datasource", notes = "adds an Interface to one Datasource", tags = { + @Operation(summary = "adds a new Interface to one Datasource", notes = "adds an Interface to one Datasource", tags = { API, W }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void addApi(@RequestBody final ApiDetails api) throws DsmException { if (StringUtils.isBlank(api.getDatasource())) { throw new DsmException(HttpStatus.SC_BAD_REQUEST, "missing datasource id"); } @@ -379,36 +379,36 @@ public class DsmApiController extends AbstractExporterController { private OperationManager operationManager; @RequestMapping(value = "/dsm/ops", method = RequestMethod.GET) - @ApiOperation(value = "get the number of pending operations", notes = "get the number of pending operations", tags = { + @Operation(summary = "get the number of pending operations", notes = "get the number of pending operations", tags = { R, M }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public int getOps() throws DsmException { return operationManager.getOpSize(); } @RequestMapping(value = "/dsm/killops", method = RequestMethod.POST) - @ApiOperation(value = "interrupts the pending operations", notes = "return the number of interrupted operations", tags = { + @Operation(summary = "interrupts the pending operations", notes = "return the number of interrupted operations", tags = { W, M }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public int killOps() throws DsmException { return operationManager.dropAll(); } @RequestMapping(value = "/dsm/dropcache", method = RequestMethod.POST) - @ApiOperation(value = "drop the caches", notes = "drop the internal caches", tags = { + @Operation(summary = "drop the caches", notes = "drop the internal caches", tags = { W, M }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void dropCache() throws DsmException { dsmCore.dropCaches(); diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/AggregationHistoryResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/AggregationHistoryResponse.java index eeddbc94..fc2885c1 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/AggregationHistoryResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/AggregationHistoryResponse.java @@ -7,11 +7,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel +@Schema @JsonAutoDetect public class AggregationHistoryResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List aggregationInfo; public AggregationHistoryResponse(List aggregationInfo) { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetails.java index 0c559702..cac6fcbd 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetails.java @@ -9,61 +9,61 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel(value = "Api model", description = "provides information about the datasource API") +@Schema(value = "Api model", description = "provides information about the datasource API") public class ApiDetails extends ApiIgnoredProperties { - @ApiModelProperty(position = 0) + @Schema(position = 0) private String id = null; - @ApiModelProperty(position = 1) + @Schema(position = 1) private String protocol = null; - @ApiModelProperty(position = 2) + @Schema(position = 2) private String datasource = null; - @ApiModelProperty(position = 3) + @Schema(position = 3) private String contentdescription = null; - @ApiModelProperty(position = 4) + @Schema(position = 4) private String eoscDatasourceType = null; - @ApiModelProperty(position = 5) + @Schema(position = 5) private String compatibility; - @ApiModelProperty(position = 7) + @Schema(position = 7) private String compatibilityOverride; - @ApiModelProperty(position = 8) + @Schema(position = 8) private Integer lastCollectionTotal; - @ApiModelProperty(position = 9) + @Schema(position = 9) private Date lastCollectionDate; - @ApiModelProperty(position = 10) + @Schema(position = 10) private Integer lastAggregationTotal; - @ApiModelProperty(position = 11) + @Schema(position = 11) private Date lastAggregationDate; - @ApiModelProperty(position = 12) + @Schema(position = 12) private Integer lastDownloadTotal; - @ApiModelProperty(position = 13) + @Schema(position = 13) private Date lastDownloadDate; - @ApiModelProperty(position = 14) + @Schema(position = 14) private String baseurl; - @ApiModelProperty(position = 15) + @Schema(position = 15) protected Boolean removable = false; - @ApiModelProperty(position = 16) + @Schema(position = 16) private Set apiParams; - @ApiModelProperty(position = 17) + @Schema(position = 17) private String metadataIdentifierPath = ""; - @ApiModelProperty(position = 18) + @Schema(position = 18) private String typology = null; public String getId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetailsResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetailsResponse.java index 495dc908..60e8cbe0 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetailsResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/ApiDetailsResponse.java @@ -6,11 +6,11 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -@ApiModel +@Schema @JsonAutoDetect public class ApiDetailsResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List api; public List getApi() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionInfo.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionInfo.java index 60df410d..6652f4e4 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionInfo.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionInfo.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModel; /** * Created by claudio on 29/11/2016. */ -@ApiModel +@Schema @JsonAutoDetect public class CollectionInfo extends AggregationInfo { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionMode.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionMode.java index 996bd6bf..84069087 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionMode.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/CollectionMode.java @@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModel; /** * Created by claudio on 12/09/16. */ -@ApiModel +@Schema @JsonAutoDetect public enum CollectionMode { REFRESH, INCREMENTAL diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailResponse.java index 75ca070b..d08789ff 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailResponse.java @@ -6,11 +6,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel +@Schema @JsonAutoDetect public class DatasourceDetailResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List datasourceInfo; public DatasourceDetailResponse(List datasourceInfo) { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java index 1434b61b..89a99028 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java @@ -16,121 +16,121 @@ import io.swagger.annotations.ApiModelProperty; * Created by claudio on 12/09/16. */ @JsonAutoDetect -@ApiModel(value = "Datasource model", description = "provides information about the datasource") +@Schema(value = "Datasource model", description = "provides information about the datasource") public class DatasourceDetails extends DatasourceIgnoredProperties { @NotBlank - @ApiModelProperty(position = 0) + @Schema(position = 0) private String id; @Transient - @ApiModelProperty(position = 1) + @Schema(position = 1) private String openaireId; @NotBlank - @ApiModelProperty(position = 2) + @Schema(position = 2) private String officialname; @NotBlank - @ApiModelProperty(position = 3) + @Schema(position = 3) private String englishname; - @ApiModelProperty(position = 4) + @Schema(position = 4) private String websiteurl; - @ApiModelProperty(position = 5) + @Schema(position = 5) private String logourl; @Email - @ApiModelProperty(position = 6) + @Schema(position = 6) private String contactemail; - @ApiModelProperty(position = 7) + @Schema(position = 7) private Double latitude; - @ApiModelProperty(position = 8) + @Schema(position = 8) private Double longitude; - @ApiModelProperty(position = 9) + @Schema(position = 9) private String timezone; @NotBlank - @ApiModelProperty(position = 10) + @Schema(position = 10) private String namespaceprefix; - @ApiModelProperty(position = 11) + @Schema(position = 11) private String languages; - @ApiModelProperty(position = 12) + @Schema(position = 12) private Date dateofvalidation; @NotBlank - @ApiModelProperty(position = 13) + @Schema(position = 13) private String eoscDatasourceType; - @ApiModelProperty(position = 14) + @Schema(position = 14) private Date dateofcollection; - @ApiModelProperty(position = 15) + @Schema(position = 15) private String platform; - @ApiModelProperty(position = 16) + @Schema(position = 16) private String activationId; - @ApiModelProperty(position = 17) + @Schema(position = 17) private String description; - @ApiModelProperty(position = 18) + @Schema(position = 18) private String issn; - @ApiModelProperty(position = 19) + @Schema(position = 19) private String eissn; - @ApiModelProperty(position = 20) + @Schema(position = 20) private String lissn; @Email - @ApiModelProperty(position = 21) + @Schema(position = 21) private String registeredby; - @ApiModelProperty(position = 22) + @Schema(position = 22) private String subjects; - @ApiModelProperty(position = 23) + @Schema(position = 23) protected String aggregator = "OPENAIRE"; - @ApiModelProperty(position = 24) + @Schema(position = 24) protected String collectedfrom; - @ApiModelProperty(position = 25) + @Schema(position = 25) private Boolean managed; - @ApiModelProperty(position = 28) + @Schema(position = 28) private Boolean consentTermsOfUse; - @ApiModelProperty(position = 29) + @Schema(position = 29) private Boolean fullTextDownload; - @ApiModelProperty(position = 30) + @Schema(position = 30) private Date consentTermsOfUseDate; - @ApiModelProperty(position = 31) + @Schema(position = 31) private Date lastConsentTermsOfUseDate; - @ApiModelProperty(position = 26) + @Schema(position = 26) private Set organizations; - @ApiModelProperty(position = 27) + @Schema(position = 27) private Set identities; - @ApiModelProperty(position = 32) + @Schema(position = 32) private String status; @Deprecated - @ApiModelProperty(position = 33) + @Schema(position = 33) private String typology; - @ApiModelProperty(position = 34) + @Schema(position = 34) private Date registrationdate; public String getId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java index 15305026..2cfd12e8 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java @@ -15,73 +15,73 @@ import io.swagger.annotations.ApiModelProperty; * Created by claudio on 12/09/16. */ @JsonAutoDetect -@ApiModel(value = "Datasource updatable fields model", description = "provides information about the datasource field that can be updated") +@Schema(value = "Datasource updatable fields model", description = "provides information about the datasource field that can be updated") public class DatasourceDetailsUpdate { @NotBlank - @ApiModelProperty(position = 0) + @Schema(position = 0) private String id; @NotBlank - @ApiModelProperty(position = 2) + @Schema(position = 2) private String officialname; @NotBlank - @ApiModelProperty(position = 3) + @Schema(position = 3) private String englishname; - @ApiModelProperty(position = 4) + @Schema(position = 4) private String websiteurl; - @ApiModelProperty(position = 5) + @Schema(position = 5) private String logourl; @Email - @ApiModelProperty(position = 6) + @Schema(position = 6) private String contactemail; - @ApiModelProperty(position = 7) + @Schema(position = 7) private Double latitude; - @ApiModelProperty(position = 8) + @Schema(position = 8) private Double longitude; - @ApiModelProperty(position = 9) + @Schema(position = 9) private String timezone; @Deprecated - @ApiModelProperty(position = 12) + @Schema(position = 12) private String typology; - @ApiModelProperty(position = 13) + @Schema(position = 13) private String eoscDatasourceType; - @ApiModelProperty(position = 15) + @Schema(position = 15) private String platform; - @ApiModelProperty(position = 17) + @Schema(position = 17) private String description; @Email - @ApiModelProperty(position = 21) + @Schema(position = 21) private String registeredby; - @ApiModelProperty(position = 25) + @Schema(position = 25) private Boolean managed; - @ApiModelProperty(position = 27) + @Schema(position = 27) private Set identities; - @ApiModelProperty(position = 28) + @Schema(position = 28) private Boolean consentTermsOfUse; - @ApiModelProperty(position = 29) + @Schema(position = 29) private Date consentTermsOfUseDate; - @ApiModelProperty(position = 29) + @Schema(position = 29) private Date lastConsentTermsOfUseDate; - @ApiModelProperty(position = 31) + @Schema(position = 31) private Boolean fullTextDownload; public String getId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsWithApis.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsWithApis.java index a306e0ae..7e2b90d3 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsWithApis.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsWithApis.java @@ -12,10 +12,10 @@ import io.swagger.annotations.ApiModelProperty; * Created by claudio on 12/09/16. */ @JsonAutoDetect -@ApiModel(value = "Datasource model with apis", description = "provides information about the datasource and its apis") +@Schema(value = "Datasource model with apis", description = "provides information about the datasource and its apis") public class DatasourceDetailsWithApis { - @ApiModelProperty(position = 1) + @Schema(position = 1) private DatasourceDetails datasource; public DatasourceDetails getDatasource() { @@ -26,7 +26,7 @@ public class DatasourceDetailsWithApis { this.datasource = datasource; } - @ApiModelProperty(position = 2) + @Schema(position = 2) private List apis = new ArrayList<>(); public List getApis() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceInfo.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceInfo.java index 74c8f7cb..d5fe928c 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceInfo.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceInfo.java @@ -8,34 +8,34 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel(value = "Datasource info model", description = "provides information about the datasource and its aggregation status") +@Schema(value = "Datasource info model", description = "provides information about the datasource and its aggregation status") public class DatasourceInfo { - @ApiModelProperty(position = 0) + @Schema(position = 0) private long indexRecords; - @ApiModelProperty(position = 1) + @Schema(position = 1) private long fundedContent; - @ApiModelProperty(position = 2) + @Schema(position = 2) private long fulltexts; - @ApiModelProperty(position = 3) + @Schema(position = 3) private String lastIndexingDate; - @ApiModelProperty(position = 4) + @Schema(position = 4) private String firstHarvestDate; - @ApiModelProperty(position = 5) + @Schema(position = 5) private DatasourceDetails datasource; - @ApiModelProperty(position = 6) + @Schema(position = 6) private AggregationInfo lastCollection; - @ApiModelProperty(position = 7) + @Schema(position = 7) private AggregationInfo lastTransformation; - @ApiModelProperty(position = 8) + @Schema(position = 8) private List aggregationHistory; public DatasourceInfo() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceResponse.java index daae0a07..973d9fd1 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceResponse.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.google.common.collect.Lists; import io.swagger.annotations.ApiModel; -@ApiModel +@Schema @JsonAutoDetect public class DatasourceResponse extends Response { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSearchResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSearchResponse.java index ecf9e77f..c35abc84 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSearchResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSearchResponse.java @@ -6,11 +6,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel +@Schema @JsonAutoDetect public class DatasourceSearchResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List datasourceInfo; public DatasourceSearchResponse(List datasourceInfo) { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippet.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippet.java index 34fda827..466356fe 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippet.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippet.java @@ -8,19 +8,19 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel(value = "Datasource model", description = "provides information about the datasource") +@Schema(value = "Datasource model", description = "provides information about the datasource") public class DatasourceSnippet { @NotBlank - @ApiModelProperty(position = 0) + @Schema(position = 0) private String id; @NotBlank - @ApiModelProperty(position = 2) + @Schema(position = 2) private String officialname; @NotBlank - @ApiModelProperty(position = 3) + @Schema(position = 3) private String englishname; public String getId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java index 69dcab91..bb429bc3 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java @@ -12,57 +12,57 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel(value = "Datasource model", description = "provides extended information about the datasource") +@Schema(value = "Datasource model", description = "provides extended information about the datasource") public class DatasourceSnippetExtended { @NotBlank - @ApiModelProperty(position = 0) + @Schema(position = 0) private String id; @NotBlank - @ApiModelProperty(position = 2) + @Schema(position = 2) private String officialname; @NotBlank - @ApiModelProperty(position = 3) + @Schema(position = 3) private String englishname; - @ApiModelProperty(position = 4) + @Schema(position = 4) private String websiteurl; @Email - @ApiModelProperty(position = 5) + @Schema(position = 5) private String registeredby; - @ApiModelProperty(position = 6) + @Schema(position = 6) private Date registrationdate; - @ApiModelProperty(position = 7) + @Schema(position = 7) private String eoscDatasourceType; - @ApiModelProperty(position = 8) + @Schema(position = 8) private String logoUrl; - @ApiModelProperty(position = 9) + @Schema(position = 9) private String description; - @ApiModelProperty(position = 10) + @Schema(position = 10) private Boolean consentTermsOfUse; - @ApiModelProperty(position = 11) + @Schema(position = 11) private Date consentTermsOfUseDate; - @ApiModelProperty(position = 12) + @Schema(position = 12) private Date lastConsentTermsOfUseDate; - @ApiModelProperty(position = 13) + @Schema(position = 13) private Boolean fullTextDownload; - @ApiModelProperty(position = 14) + @Schema(position = 14) private Set organizations; @Deprecated - @ApiModelProperty(position = 15) + @Schema(position = 15) private String typology; public String getId() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetResponse.java index a5636b65..90449158 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetResponse.java @@ -6,11 +6,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel +@Schema @JsonAutoDetect public class DatasourceSnippetResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List datasourceInfo; public DatasourceSnippetResponse(List datasourceInfo) { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/FilterName.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/FilterName.java index cfbcd4db..c7a5b5c1 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/FilterName.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/FilterName.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.annotations.ApiModel; @JsonAutoDetect -@ApiModel(value = "Filter name", description = "List of the field names used to filter datasources") +@Schema(value = "Filter name", description = "List of the field names used to filter datasources") public enum FilterName { id, diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Header.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Header.java index 81dc2d67..25213902 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Header.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Header.java @@ -11,26 +11,26 @@ import com.google.gson.GsonBuilder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -@ApiModel +@Schema @JsonAutoDetect public class Header { - @ApiModelProperty(position = 0) + @Schema(position = 0) private long total; - @ApiModelProperty(position = 1) + @Schema(position = 1) private int page; - @ApiModelProperty(position = 2) + @Schema(position = 2) private int size; - @ApiModelProperty(position = 3) + @Schema(position = 3) private long time; - @ApiModelProperty(position = 4) + @Schema(position = 4) private int statusCode; - @ApiModelProperty(position = 5) + @Schema(position = 5) private List errors = Lists.newArrayList(); @JsonIgnore diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/IdentitiesDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/IdentitiesDetails.java index ff389b38..684d82cc 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/IdentitiesDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/IdentitiesDetails.java @@ -3,7 +3,7 @@ package eu.dnetlib.openaire.dsm.domain; import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.annotations.ApiModel; -@ApiModel +@Schema @JsonAutoDetect public class IdentitiesDetails { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/OrganizationDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/OrganizationDetails.java index 79dd5a3c..6974c286 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/OrganizationDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/OrganizationDetails.java @@ -8,24 +8,24 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel(value = "Organization info model", description = "provides information about the organization") +@Schema(value = "Organization info model", description = "provides information about the organization") public class OrganizationDetails extends OrganizationIgnoredProperties { - @ApiModelProperty(position = 0) + @Schema(position = 0) private String legalshortname; @NotBlank - @ApiModelProperty(position = 1) + @Schema(position = 1) private String legalname; - @ApiModelProperty(position = 2) + @Schema(position = 2) private String websiteurl; - @ApiModelProperty(position = 3) + @Schema(position = 3) private String logourl; @NotBlank - @ApiModelProperty(position = 4) + @Schema(position = 4) private String country; public String getLegalshortname() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/RequestFilter.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/RequestFilter.java index 4275db07..35a37abb 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/RequestFilter.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/RequestFilter.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.annotations.ApiModel; @JsonAutoDetect -@ApiModel(value = "Request filter", description = "field name and value pairs") +@Schema(value = "Request filter", description = "field name and value pairs") public class RequestFilter extends HashMap { /** diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Response.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Response.java index d52b499a..f8f9adf7 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Response.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/Response.java @@ -5,12 +5,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @JsonAutoDetect -@ApiModel( +@Schema( value = "Api response model", description = "Api response model, provides a response header") public class Response { - @ApiModelProperty(position = 0) + @Schema(position = 0) private Header header; public Response() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/SimpleResponse.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/SimpleResponse.java index cb79eb9c..f3a6d774 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/SimpleResponse.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/SimpleResponse.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -@ApiModel +@Schema @JsonAutoDetect public class SimpleResponse extends Response { - @ApiModelProperty(position = 1) + @Schema(position = 1) private List response; public List getResponse() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/TransformationInfo.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/TransformationInfo.java index b4ccc38b..ec1386d0 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/TransformationInfo.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/TransformationInfo.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModel; /** * Created by claudio on 29/11/2016. */ -@ApiModel +@Schema @JsonAutoDetect public class TransformationInfo extends AggregationInfo { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/ApiParamDbEntry.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/ApiParamDbEntry.java index 59a90314..e9971497 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/ApiParamDbEntry.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/ApiParamDbEntry.java @@ -15,7 +15,7 @@ import io.swagger.annotations.ApiModel; @Entity @Table(name = "dsm_apiparams") @JsonIgnoreProperties(ignoreUnknown = true) -@ApiModel(value = "Datasource Api params model", description = "describes the datasource api params") +@Schema(value = "Datasource Api params model", description = "describes the datasource api params") public class ApiParamDbEntry implements ApiParam { @EmbeddedId diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/CountryTerm.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/CountryTerm.java index 87b78ed8..6ece8fc9 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/CountryTerm.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/CountryTerm.java @@ -14,7 +14,7 @@ import io.swagger.annotations.ApiModel; */ @Entity @Table(name = "browse_countries") -@ApiModel +@Schema @JsonAutoDetect public class CountryTerm implements Comparable, BrowseTerm { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/DatasourceApiDbEntry.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/DatasourceApiDbEntry.java index 064c4f41..e09bf0fe 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/DatasourceApiDbEntry.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/db/DatasourceApiDbEntry.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModel; @Entity @JsonAutoDetect @Table(name = "dsm_datasource_api") -@ApiModel(value = "DatasourceApi model", description = "describes a joint view between datasources and their API (1:N)") +@Schema(value = "DatasourceApi model", description = "describes a joint view between datasources and their API (1:N)") public class DatasourceApiDbEntry { @Id diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/funders/FundersApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/funders/FundersApiController.java index 6a3f72b8..43dfc4d8 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/funders/FundersApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/funders/FundersApiController.java @@ -27,13 +27,13 @@ public class FundersApiController extends AbstractExporterController { private FunderDao fDao; @RequestMapping(value = "/funders", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "get basic information about funders", notes = "basic information about funders: id, name, shortname, last update date, registration date", response = FunderDetails[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = FunderDetails[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = FunderDetails[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public List getFunders( @PathVariable final int page, @PathVariable final int size) throws FundersApiException { @@ -42,10 +42,10 @@ public class FundersApiController extends AbstractExporterController { } @RequestMapping(value = "/funder/{id}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get the funder details", notes = "complete funder information", response = FunderDbEntry.class) + @Operation(summary = "get the funder details", notes = "complete funder information", response = FunderDbEntry.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = FunderDbEntry.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = FunderDbEntry.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public ExtendedFunderDetails getFunderDetails( @PathVariable final String id) throws FundersApiException { @@ -53,10 +53,10 @@ public class FundersApiController extends AbstractExporterController { } @RequestMapping(value = "/funder/ids", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get the list of funder ids", notes = "get the list of funder ids", response = String[].class) + @Operation(summary = "get the list of funder ids", notes = "get the list of funder ids", response = String[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = String[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = String[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public List getFunderIds( @PathVariable final int page, @PathVariable final int size diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/info/InfoController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/info/InfoController.java index a3027500..25a2a0d6 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/info/InfoController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/info/InfoController.java @@ -41,12 +41,12 @@ public class InfoController extends AbstractExporterController { @RequestMapping(value = "/info/{infoKey}", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get info date", notes = "get info date", tags = { + @Operation(summary = "get info date", notes = "get info date", tags = { ExporterConstants.R }, response = LocalDate.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = LocalDate.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = LocalDate.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public LocalDate getDate(@PathVariable final String infoKey) { final JdbcInfoDao.DATE_INFO info = JdbcInfoDao.DATE_INFO.valueOf(infoKey); @@ -57,12 +57,12 @@ public class InfoController extends AbstractExporterController { @RequestMapping(value = "/info", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get all the info date", notes = "get all the info date", tags = { + @Operation(summary = "get all the info date", notes = "get all the info date", tags = { ExporterConstants.R }, response = Map.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = LocalDate.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = LocalDate.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public Map listInfo() { final Map map = Maps.newHashMap(); @@ -75,12 +75,12 @@ public class InfoController extends AbstractExporterController { @RequestMapping(value = "/info/keys", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "get the available keys", notes = "get the available keys", tags = { + @Operation(summary = "get the available keys", notes = "get the available keys", tags = { ExporterConstants.R }, response = String.class, responseContainer = "List") @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = LocalDate.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) + @ApiResponse(responseCode = "200", description = "OK", response = LocalDate.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public List listInfoKeys() { final List keys = Lists.newArrayList(); @@ -93,7 +93,7 @@ public class InfoController extends AbstractExporterController { @RequestMapping(value = "/info/dropCache", produces = { "application/json" }, method = RequestMethod.GET) - @ApiOperation(value = "Drops the info cache", notes = "Drops the info cache", tags = { + @Operation(summary = "Drops the info cache", notes = "Drops the info cache", tags = { ExporterConstants.R }) public void dropCache() { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/ProjectsController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/ProjectsController.java index 00abbcf2..e12dc823 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/ProjectsController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/ProjectsController.java @@ -58,14 +58,14 @@ public class ProjectsController extends AbstractExporterController { private ProjectQueryParamsFactory projectQueryParamsFactory; @RequestMapping(value = "/export/**/project/dspace.do", method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "DSpace", notes = "return project information in compatible with the OpenAIRE plugin for DSpace", tags = { ExporterConstants.DSPACE }, response = String.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = String.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = String.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void processDspace(final HttpServletRequest request, final ServletResponse response, @RequestParam(value = "startFrom", required = false) final String startFrom, @RequestParam(value = "startUntil", required = false) final String startUntil, @@ -86,14 +86,14 @@ public class ProjectsController extends AbstractExporterController { } @RequestMapping(value = "/export/**/project/eprints.do", method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "EPrints", notes = "return project information in compatible with the OpenAIRE plugin for Eprints", tags = { ExporterConstants.EPRINT }, response = String.class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = String.class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = String.class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void processEprints(final HttpServletRequest request, final ServletResponse response, @RequestParam(value = "startFrom", required = false) final String startFrom, @RequestParam(value = "startUntil", required = false) final String startUntil, @@ -122,14 +122,14 @@ public class ProjectsController extends AbstractExporterController { } @RequestMapping(value = "/noads/project2tsv.do", method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "TSV", notes = "download project information in TSV format", tags = { ExporterConstants.TSV }, response = ProjectTsv[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ProjectTsv[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = ProjectTsv[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void processTsv(final HttpServletResponse response, @RequestParam(value = "funding", required = true) final String funding, @RequestParam(value = "article293", required = false) final Boolean article293) throws Exception { @@ -148,14 +148,14 @@ public class ProjectsController extends AbstractExporterController { } @RequestMapping(value = "/export/streamProjectDetails.do", method = RequestMethod.GET) - @ApiOperation( + @Operation( value = "Stream projects", notes = "stream project information", tags = { ExporterConstants.STREAMING }, response = ProjectDetails[].class) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ProjectDetails[].class), - @ApiResponse(code = 500, message = "unexpected error", response = ErrorMessage.class) }) + @ApiResponse(responseCode = "200", description = "OK", response = ProjectDetails[].class), + @ApiResponse(responseCode = "500", description = "unexpected error", response = ErrorMessage.class) }) public void streamProjectDetails(final HttpServletResponse response, @RequestParam(value = "format", required = true) final String format, @RequestParam(value = "compress", required = false) final Boolean compress) throws IOException, SQLException { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectApi.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectApi.java index 361f6534..fe497340 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectApi.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectApi.java @@ -17,7 +17,7 @@ import org.apache.commons.lang3.StringUtils; */ @Entity @Table(name = "projects_api") -@ApiModel(value = "Project api model", description = "Project api model used by DSpace and Eprints exporter") +@Schema(value = "Project api model", description = "Project api model used by DSpace and Eprints exporter") public class ProjectApi { public static final String INFO_EU_REPO_GRANT_AGREEMENT = "info:eu-repo/grantAgreement/"; diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectDetails.java index e4bb8ad3..80279463 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectDetails.java @@ -27,7 +27,7 @@ import org.supercsv.util.CsvContext; */ @Entity @Table(name = "project_details") -@ApiModel(value = "Project details model", description = "provides project details") +@Schema(value = "Project details model", description = "provides project details") public class ProjectDetails { @Transient diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectTsv.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectTsv.java index fdf7bd05..23f201c9 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectTsv.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/project/domain/db/ProjectTsv.java @@ -17,7 +17,7 @@ import org.apache.commons.lang3.StringUtils; */ @Entity @Table(name = "projects_tsv") -@ApiModel(value = "Project TSV model", description = "project TSV model description") +@Schema(value = "Project TSV model", description = "project TSV model description") public class ProjectTsv { @Id diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/MainApplication.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/MainApplication.java index f75b9eef..f5d0841f 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/MainApplication.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/MainApplication.java @@ -7,11 +7,11 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import eu.dnetlib.common.app.AbstractDnetApp; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; + + + + + @SpringBootApplication @EnableSwagger2 diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/MainApplication.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/MainApplication.java index 98de0853..e8178368 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/MainApplication.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/MainApplication.java @@ -12,12 +12,12 @@ import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; + + + + + + import java.time.Duration; import java.util.Arrays; diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/DatasourceV1.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/DatasourceV1.java index ea5f58a1..e4491b41 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/DatasourceV1.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/DatasourceV1.java @@ -22,7 +22,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/v1") -@Api(tags = { +@Tag(tags = { "Datasources" }) public class DatasourceV1 extends AbstractDnetController { diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkProviderV2.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkProviderV2.java index ecce061e..7b4ec1bc 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkProviderV2.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkProviderV2.java @@ -19,7 +19,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/v2") -@Api(tags = { +@Tag(tags = { "LinkProvider : Operation related to the Link Provider" }) public class LinkProviderV2 { diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkPublisherV2.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkPublisherV2.java index e1a9210c..6541d3b9 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkPublisherV2.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkPublisherV2.java @@ -19,7 +19,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/v2/LinkPublisher") -@Api(tags = { +@Tag(tags = { "LinkPublisher : Operation related to the Link Publisher" }) public class LinkPublisherV2 { diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV1.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV1.java index 661f963e..04cc1aac 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV1.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV1.java @@ -26,7 +26,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/v1") -@Api(tags = {"Scholix"}) +@Tag(tags = {"Scholix"}) public class ScholixControllerV1 extends AbstractDnetController { @Autowired diff --git a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV2.java b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV2.java index f205c45a..d465a787 100644 --- a/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV2.java +++ b/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/ScholixControllerV2.java @@ -24,7 +24,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/v2") -@Api(tags = { +@Tag(tags = { "Links : Operation related to the Scholix Links" }) public class ScholixControllerV2 extends AbstractDnetController { @@ -33,7 +33,7 @@ public class ScholixControllerV2 extends AbstractDnetController { private ScholixIndexManager manager; @Timed(value = "scholix.v2.links", description = "Time taken to return links on Version 2.0 of Scholix") - @ApiOperation("Get Scholix Links") + @Operation(summary = "Get Scholix Links") @GetMapping("/Links") public PageResultType links( @Parameter(in = ParameterIn.QUERY, diff --git a/libs/dnet-apps-common/pom.xml b/libs/dnet-apps-common/pom.xml index 737df2d6..9f8fbb22 100644 --- a/libs/dnet-apps-common/pom.xml +++ b/libs/dnet-apps-common/pom.xml @@ -41,8 +41,8 @@ - io.springfox - springfox-boot-starter + org.springdoc + springdoc-openapi-ui diff --git a/libs/dnet-apps-common/src/main/java/eu/dnetlib/common/app/AbstractDnetApp.java b/libs/dnet-apps-common/src/main/java/eu/dnetlib/common/app/AbstractDnetApp.java index 7b03ce88..4dd18064 100644 --- a/libs/dnet-apps-common/src/main/java/eu/dnetlib/common/app/AbstractDnetApp.java +++ b/libs/dnet-apps-common/src/main/java/eu/dnetlib/common/app/AbstractDnetApp.java @@ -17,8 +17,7 @@ import org.springframework.core.io.ClassPathResource; import io.micrometer.core.instrument.ImmutableTag; import io.micrometer.core.instrument.Metrics; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; +import io.swagger.v3.oas.models.OpenAPI; public abstract class AbstractDnetApp { @@ -46,16 +45,14 @@ public abstract class AbstractDnetApp { } @Bean - public Docket newSwaggerDocket() { - log.info("Initializing SWAGGER..."); + public OpenAPI newSwaggerDocket() { + final OpenAPI openAPI = new OpenAPI(); - final Docket docket = new Docket(DocumentationType.SWAGGER_2); + configSwagger(openAPI); - configSwagger(docket); - - return docket; + return openAPI; } - protected abstract void configSwagger(final Docket docket); + protected abstract void configSwagger(final OpenAPI openAPI); } diff --git a/libs/dnet-broker-apps-common/pom.xml b/libs/dnet-broker-apps-common/pom.xml index add12ee0..48ebe948 100644 --- a/libs/dnet-broker-apps-common/pom.xml +++ b/libs/dnet-broker-apps-common/pom.xml @@ -66,8 +66,8 @@ - io.springfox - springfox-boot-starter + org.springdoc + springdoc-openapi-ui provided diff --git a/pom.xml b/pom.xml index 7f575596..80951f83 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 eu.dnetlib.dhp dnet-applications - 3.2.10-SNAPSHOT + 3.2.9-SNAPSHOT pom @@ -247,12 +247,11 @@ - io.springfox - springfox-boot-starter - 3.0.0 + org.springdoc + springdoc-openapi-ui + 1.6.10 - org.apache.hadoop @@ -450,7 +449,6 @@ 2.11.33 7.1.0 3.4.2 - 2.8.0 0.10.0 1.71.0 false