-
Notifications
You must be signed in to change notification settings - Fork 0
π¨chore : μ΄μμλ²μ λ§κ² μμ #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "feat/\uC778\uD504\uB77C-\uAD00\uB828-\uAE30\uB2A5-\uAD6C\uD604"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||||||||||||||||||||||||||
| package com.pinHouse.server.core.config.swaagger; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||||||||||||||||||||||||||||||
| import io.swagger.v3.oas.annotations.servers.Server; | ||||||||||||||||||||||||||||||
| import io.swagger.v3.oas.models.OpenAPI; | ||||||||||||||||||||||||||||||
| import io.swagger.v3.oas.models.info.Info; | ||||||||||||||||||||||||||||||
| import io.swagger.v3.oas.models.media.Schema; | ||||||||||||||||||||||||||||||
| import org.springdoc.core.customizers.OpenApiCustomizer; | ||||||||||||||||||||||||||||||
| import org.springframework.context.annotation.Bean; | ||||||||||||||||||||||||||||||
| import org.springframework.context.annotation.Configuration; | ||||||||||||||||||||||||||||||
| import org.springframework.context.annotation.Profile; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import java.util.Map; | ||||||||||||||||||||||||||||||
| import java.util.TreeMap; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Swagger / OpenAPI μ€μ ν΄λμ€ | ||||||||||||||||||||||||||||||
| * - HTTPS μ€μ μΌλ‘ μΈν΄ @OpenAPIDefinition μΆκ° | ||||||||||||||||||||||||||||||
| * - μ€μ¨κ±° λ΄λΆ JWT μ€μ μΆκ° | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Configuration | ||||||||||||||||||||||||||||||
| @Profile("prod") | ||||||||||||||||||||||||||||||
| @OpenAPIDefinition(servers = {@Server(url = "https://api.pinhouse.co.kr", description = "PinHouse μ΄μ μλ²")}) | ||||||||||||||||||||||||||||||
| public class ProdSwaggerConfig { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Bean | ||||||||||||||||||||||||||||||
| public OpenAPI openAPI() { | ||||||||||||||||||||||||||||||
| return new OpenAPI() | ||||||||||||||||||||||||||||||
| .info(apiInfo()); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| private Info apiInfo() { | ||||||||||||||||||||||||||||||
| return new Info() | ||||||||||||||||||||||||||||||
| .title("PinHouse Swagger") | ||||||||||||||||||||||||||||||
| .description("ννμ°μ€ μ€μ¨κ±°μ λλ€.") | ||||||||||||||||||||||||||||||
| .version("1.0.0"); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// μ€ν€λ§ μ΄λ¦ κΈ°μ€ μ€λ¦μ°¨μ | ||||||||||||||||||||||||||||||
| @Bean | ||||||||||||||||||||||||||||||
| public OpenApiCustomizer sortSchemasAlphabetically() { | ||||||||||||||||||||||||||||||
| return openApi -> { | ||||||||||||||||||||||||||||||
| Map<String, Schema> schemas = openApi.getComponents().getSchemas(); | ||||||||||||||||||||||||||||||
| openApi.getComponents().setSchemas(new TreeMap<>(schemas)); | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OpenAPI μ€νμ μ€ν€λ§κ° μλ κ²½μ° π null μ²΄ν¬ μΆκ° μ μ `@Bean`
public OpenApiCustomizer sortSchemasAlphabetically() {
return openApi -> {
- Map<String, Schema> schemas = openApi.getComponents().getSchemas();
- openApi.getComponents().setSchemas(new TreeMap<>(schemas));
+ if (openApi.getComponents() != null && openApi.getComponents().getSchemas() != null) {
+ Map<String, Schema> schemas = openApi.getComponents().getSchemas();
+ openApi.getComponents().setSchemas(new TreeMap<>(schemas));
+ }
};
}π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ν¨ν€μ§λͺ μ μ€νκ° μμ΅λλ€.
swaaggerκ° μλswaggerκ° μ¬λ°λ₯Έ μ² μμ λλ€.π μμ μ μ
λλ ν 리λͺ λ ν¨κ» μμ ν΄μΌ ν©λλ€.
π Committable suggestion
π€ Prompt for AI Agents