Skip to content

Commit

Permalink
Customize OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 8, 2024
1 parent c8b95e5 commit 9f9c2d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
import com.uniovi.services.PlayerService;
import com.uniovi.services.RestApiService;
import com.uniovi.validators.SignUpValidator;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.servers.Server;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.media.Content;
import jakarta.servlet.http.HttpServletResponse;
Expand All @@ -32,6 +35,11 @@
import java.util.Map;
import java.util.Optional;

@OpenAPIDefinition(info = @Info(title = "Wikigame API", version = "1.0", description = "API for managing players and questions\nTo get access, please generate an API key in the webpage"),
servers = {
@Server(url = "https://wikigame.es", description = "Production server"),
@Server(url = "http://localhost:8080", description = "Local server"),
})
@Tag(name = "Player API", description = "API for managing players")
@RestController
public class PlayerApiController {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spring.jpa.hibernate.ddl-auto=update
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/api
springdoc.swagger-ui.operationsSorter=method
springdoc.packagesToScan=com.uniovi.controllers.api
springdoc.packagesToScan=com.uniovi.controllers.api

0 comments on commit 9f9c2d6

Please sign in to comment.