Skip to content

Commit

Permalink
Added application.yml configuration to sort swagger by method and alp…
Browse files Browse the repository at this point in the history
…habetic order (#73)
  • Loading branch information
LauroSilveira authored Dec 14, 2023
1 parent 46ae4ea commit 074bd54
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@

@Configuration
public class SpringdocConfiguration {
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.components(new Components()
.addSecuritySchemes("bearer-key",
new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))
.info(new Info().title("alura-flix-api")
.description("An API Rest about movies and series that implements Get, Post, Put and Delet methods."
+ " Also implements JWT security with Spring Framework")
.contact(new Contact()
.name("Lauro Correia")
.email("lauro.silveira@ymail.com"))
.license(new License()
.name("Apache 2.0")
.url("http://voll.med/api/licenca")
)
);
}
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.components(new Components()
.addSecuritySchemes("bearer-key",
new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))
.info(new Info().title("alura-flix-api")
.description("An API Rest about movies and series that implements Get, Post, Put and Delet methods."
+ " Also implements JWT security with Spring Framework")
.contact(new Contact()
.name("Lauro Correia")
.email("lauro.silveira@ymail.com"))
.license(new License()
.name("Apache 2.0")
.url("http://voll.med/api/licenca")
)
);
}

}
5 changes: 5 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ api:
security:
# always commit the uri like this: ${JWT_SECRET}
token-jwt-secret: ${JWT_SECRET}

springdoc:
swagger-ui:
operations-sorter: method
tags-sorter: alpha

0 comments on commit 074bd54

Please sign in to comment.