묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
@Controller 요청하는 방식에 대해 궁금합니다.
질문있습니다!Controller에서 데이터를 클라이언트로부터 요청 받을 때 @RequestBody, @RequestParam, @PathVariable, Dto를 활용하는데, 어떤 경우로부터 클라이언트에게 데이터를 요청받았을 때 어떤 방식을 사용하는게 맞는지를 알고 싶습니다!
-
미해결스프링부트를 활용한 RESTFUL API 만들기(AWS,EKS)
저는 맥북인데 이건 그냥 윈도우용으로만 수업하시네요
저는 맥북인데 이건 그냥 윈도우용으로만 수업하시네요 이거 지금 처음 1화? 듣고 있는데 슬슬 걱정되네요 돈낭비 아닌가 하고 맥북이라서 뭘 어떻게 해야 하는지 잘 모르겠는데요 -_-
-
해결됨[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
Swagger 강의, Unable to infer base url 이거 뜨시는 분들 도움되시라고
스프링부트 2.7 버전에서 3.1 버전으로 올려다가 강의대로 이것저것 만져주고 다시 swagger 띄우려고 했더니 'Unable to infer base url 뭐시기' 뜨길래 인텔리제이 '파일' 메뉴에서 'Invalidate caches' 로 'Clear file system ...' 만 체크해서 재기동 한 뒤에 Gradle 이나 Maven 새로고침 하고 프로젝트 기동, 'http://localhost:8088/swagger-ui/index.html' 페이지 요청 하니 제대로 나옵니다.
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
H2 접속 에러
강의 내용에 대해 질문해 주세요에러가 날 경우 본인 코드가 있는 git 주소를 알려주거나 최대한 상세히 적어주세요 ### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ITEM" not found (this database is empty); SQL statement: 라는 에러가 나요
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
item을 id로 get하는데 1을 넣었을 때 500에러가 나와요.
1넣으면 apple이 나와야 하는데, 500에러가 나오네요. 빌드는 잘 되었는데 어디가 문젠지 모르겠네요. 코드는 https://inf.run/8swaL올려두었습니다. 감사합니다!
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
swagger spring boot 3 적용 run 실행 에러
spring boot 3.4.3 버전 pom.xml 에러가 납니다 <!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui --> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.8.5</version> </dependency>main 함수 run 실행시 아래왜 같은 에러가 나옵니다 Could not transfer artifact org.springdoc:springdoc-openapi-starter-webmvc-ui:pom:2.8.5 from/to central (https://repo.maven.apache.org/maven2): 알려진 호스트가 없습니다 (repo.maven.apache.org)
-
해결됨차세대 Node.js 백엔드 서버 개발(Fastify & Prisma & Typescript와 함께하는)
Swagger 문서 접근 권한
안녕하세요 Swagger UI의 경우 실제 서비스를 배포했을 때, 일반 유저는 /documentation에 접근하지 못 하도록 설정할 수 있나요? 내부 개발자들만 볼 수 있도록 접근 권한을 막는 방법이 있는지 궁금합니다. 감사합니다.
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
Invalid bound statement (not found): com.helloword.fitstStart.mapper.QuickMapper.findById 에 대한 질의 입니다.
[오류내용]SERVICE에서 MAPPER까지 값은 1로 잘 넘어 오는데MAPPER에서 XML로 넘어가는 부분에서 오류가 납니다.[오류 SCRIPT]2024-05-23T12:14:49.232+09:00 INFO 5380 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms2024-05-23T12:14:49.272+09:00 INFO 5380 --- [nio-8080-exec-1] c.h.fitstStart.service.QuickService : 111111 ...12024-05-23T12:14:49.275+09:00 ERROR 5380 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.helloword.fitstStart.mapper.QuickMapper.findById] with root causeorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.helloword.fitstStart.mapper.QuickMapper.findById at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:229) ~[mybatis-3.5.14.jar:3.5.14]
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
QuickMapper를 찾을 수 없다는 오류가 뜹니다. @Autowired 사용에 문제가 있는 걸까요?
안녕하세요?강의 내용이 너무 좋아서 빠져서 듣고 있습니다.그런데 mybatis연결 과정에서 QuickMapper interface와 xml연결하는 부분 수업 중에 아래와 같은 에러가 발생했습니다. 에러 내용만 보면 Service 에서 QuickMapper를 @Autowired하는 부분부터 문제가 생기는 것 같은데 해결방법을 모르겠습니다.현재 에러가 나는 상태로 git에 소스 올려두었습니다.https://github.com/ljpson/quickstart.git에러 내용은 아래와 같습니다. 2024-04-03T11:20:24.392+09:00 WARN 74964 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'quickController': Unsatisfied dependency expressed through field 'quickService': Error creating bean with name 'quickService': Unsatisfied dependency expressed through field 'quickMapper': No qualifying bean of type 'com.helloworld.quickstart.mapper.QuickMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}2024-04-03T11:20:24.395+09:00 INFO 74964 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]2024-04-03T11:20:24.404+09:00 INFO 74964 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.2024-04-03T11:20:24.418+09:00 ERROR 74964 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :***************************APPLICATION FAILED TO START***************************Description:Field quickMapper in com.helloworld.quickstart.service.QuickService required a bean of type 'com.helloworld.quickstart.mapper.QuickMapper' that could not be found.The injection point has the following annotations:- @org.springframework.beans.factory.annotation.Autowired(required=true)Action:Consider defining a bean of type 'com.helloworld.quickstart.mapper.QuickMapper' in your configuration.Process finished with exit code 1
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
mybatis의 hashmap 데이터 호출시 대문자로 불러와야 되나요?
강의 내용에 대해 질문해 주세요에러가 날 경우 본인 코드가 있는 git 주소를 알려주거나 최대한 상세히 적어주세요 소문자로하면 null로만 나옵니다...
-
미해결1시간만에 끝내는 spring boot rest api 서비스 개발
@Autowired 관련
강의 내용에 대해 질문해 주세요에러가 날 경우 본인 코드가 있는 git 주소를 알려주거나 최대한 상세히 적어주세요 @Autowired 를 사용해도 QuickService가 호출되지 않는 것 같습니다 어떻게 해야 하나요?
-
해결됨1시간만에 끝내는 spring boot rest api 서비스 개발
마이바티스 - 해쉬맵
안녕하세요! 강의 잘듣고있습니다! 마이바티스 설정관련 parameter를 1개임에도 불구하고 HashMap으로 감싸서 보내는데 원래 마이바이스트 매개변수 넘길때 보통 해쉬맵으로 감싸서 보내나요?또한가지 만약 넘겨줄 매개변수가 Object 타입 (id,username....), String 타입 2가지 혹은 그 이상인 경우에도 해쉬맵에 Object도 매핑해서 보내준 후 #{objec명.필드명} 이런식으로 빼쓰나요?
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
swagger거 실행할려고 서버실행시 문제 발생
swaggerConfigpackage com.example.restfulness.config; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @OpenAPIDefinition public class SwaggerConfig { @Bean public OpenAPI api() { Info info=new Info().title("").version("v3").description("api"); // Info info=new Info().title().version("v3").description("api"); // Info info=new Info().title("").version return new OpenAPI().components(new Components()).info(info); } }gradle.buildplugins { id 'java' id 'org.springframework.boot' version '3.1.4' id 'io.spring.dependency-management' version '1.1.3' } group = 'com.example' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.springframework.boot:spring-boot-starter-validation' //@XML implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' //@헤테오스 implementation 'org.springframework.boot:spring-boot-starter-hateoas' //implementation 'org.springframework.boot:spring-boot-starter-parent' //@스웨거 implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.4' //implementation 'org.springdoc:springdoc-openapi-ui' } tasks.named('test') { useJUnitPlatform() } 그리고 서버를 재 구동했는데 다음과 같은 메세지가 나타났습니다. 어떻게 해야 할까요? 4:23:01 AM: Executing 'dependencies'...> Task :dependencies------------------------------------------------------------Root project 'restfulness'------------------------------------------------------------annotationProcessor - Annotation processors and their dependencies for source set 'main'.\--- org.projectlombok:lombok -> 1.18.30bootArchives - Configuration for Spring Boot archive artifacts. (n)No dependenciescompileClasspath - Compile classpath for source set 'main'.+--- org.projectlombok:lombok -> 1.18.30+--- org.springframework.boot:spring-boot-starter-data-jpa -> 3.1.4| +--- org.springframework.boot:spring-boot-starter-aop:3.1.4| | +--- org.springframework.boot:spring-boot-starter:3.1.4| | | +--- org.springframework.boot:spring-boot:3.1.4| | | | +--- org.springframework:spring-core:6.0.12| | | | | \--- org.springframework:spring-jcl:6.0.12| | | | \--- org.springframework:spring-context:6.0.12| | | | +--- org.springframework:spring-aop:6.0.12| | | | | +--- org.springframework:spring-beans:6.0.12| | | | | | \--- org.springframework:spring-core:6.0.12 (*)| | | | | \--- org.springframework:spring-core:6.0.12 (*)| | | | +--- org.springframework:spring-beans:6.0.12 (*)| | | | +--- org.springframework:spring-core:6.0.12 (*)| | | | \--- org.springframework:spring-expression:6.0.12| | | | \--- org.springframework:spring-core:6.0.12 (*)| | | +--- org.springframework.boot:spring-boot-autoconfigure:3.1.4| | | | \--- org.springframework.boot:spring-boot:3.1.4 (*)| | | +--- org.springframework.boot:spring-boot-starter-logging:3.1.4| | | | +--- ch.qos.logback:logback-classic:1.4.11| | | | | +--- ch.qos.logback:logback-core:1.4.11| | | | | \--- org.slf4j:slf4j-api:2.0.7 -> 2.0.9| | | | +--- org.apache.logging.log4j:log4j-to-slf4j:2.20.0| | | | | +--- org.apache.logging.log4j:log4j-api:2.20.0| | | | | \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.9| | | | \--- org.slf4j:jul-to-slf4j:2.0.9| | | | \--- org.slf4j:slf4j-api:2.0.9| | | +--- jakarta.annotation:jakarta.annotation-api:2.1.1| | | +--- org.springframework:spring-core:6.0.12 (*)| | | \--- org.yaml:snakeyaml:1.33| | +--- org.springframework:spring-aop:6.0.12 (*)| | \--- org.aspectj:aspectjweaver:1.9.20| +--- org.springframework.boot:spring-boot-starter-jdbc:3.1.4| | +--- org.springframework.boot:spring-boot-starter:3.1.4 (*)| | +--- com.zaxxer:HikariCP:5.0.1| | | \--- org.slf4j:slf4j-api:1.7.30 -> 2.0.9| | \--- org.springframework:spring-jdbc:6.0.12| | +--- org.springframework:spring-beans:6.0.12 (*)| | +--- org.springframework:spring-core:6.0.12 (*)| | \--- org.springframework:spring-tx:6.0.12| | +--- org.springframework:spring-beans:6.0.12 (*)| | \--- org.springframework:spring-core:6.0.12 (*)| +--- org.hibernate.orm:hibernate-core:6.2.9.Final| | +--- jakarta.persistence:jakarta.persistence-api:3.1.0| | \--- jakarta.transaction:jakarta.transaction-api:2.0.1| +--- org.springframework.data:spring-data-jpa:3.1.4| | +--- org.springframework.data:spring-data-commons:3.1.4| | | +--- org.springframework:spring-core:6.0.12 (*)| | | +--- org.springframework:spring-beans:6.0.12 (*)| | | \--- org.slf4j:slf4j-api:2.0.2 -> 2.0.9| | +--- org.springframework:spring-orm:6.0.12| | | +--- org.springframework:spring-beans:6.0.12 (*)| | | +--- org.springframework:spring-core:6.0.12 (*)| | | +--- org.springframework:spring-jdbc:6.0.12 (*)| | | \--- org.springframework:spring-tx:6.0.12 (*)| | +--- org.springframework:spring-context:6.0.12 (*)| | +--- org.springframework:spring-aop:6.0.12 (*)| | +--- org.springframework:spring-tx:6.0.12 (*)| | +--- org.springframework:spring-beans:6.0.12 (*)| | +--- org.springframework:spring-core:6.0.12 (*)| | +--- org.antlr:antlr4-runtime:4.10.1| | +--- jakarta.annotation:jakarta.annotation-api:2.0.0 -> 2.1.1| | \--- org.slf4j:slf4j-api:2.0.2 -> 2.0.9| \--- org.springframework:spring-aspects:6.0.12| \--- org.aspectj:aspectjweaver:1.9.20+--- org.springframework.boot:spring-boot-starter-web -> 3.1.4| +--- org.springframework.boot:spring-boot-starter:3.1.4 (*)| +--- org.springframework.boot:spring-boot-starter-json:3.1.4| | +--- org.springframework.boot:spring-boot-starter:3.1.4 (*)| | +--- org.springframework:spring-web:6.0.12| | | +--- org.springframework:spring-beans:6.0.12 (*)| | | +--- org.springframework:spring-core:6.0.12 (*)| | | \--- io.micrometer:micrometer-observation:1.10.11 -> 1.11.4 중간생략No dependencies(c) - A dependency constraint, not a dependency. The dependency affected by the constraint occurs elsewhere in the tree.(*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation.(n) - A dependency or dependency configuration that cannot be resolved.A web-based, searchable dependency report is available by adding the --scan option.BUILD SUCCESSFUL in 825ms1 actionable task: 1 executed4:23:02 AM: Execution finished 'dependencies'. 주소창에 localhost:8088/v2/api-docs를 입력했더니 This application has no explicit mapping for /error, so you are seeing this as a fallback.Thu Oct 12 04:07:11 KST 2023There was an unexpected error (type=Not Found, status=404).No message available가 보입니다.
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
Spring 3.xx 이상이라면 SpringDoc 사용하세요
Spring 3 이상부터는 더 이상 Springfox가 아닌 SpringDoc으로 해야 Swagger 설정을 해줄 수 있습니다.자세한 내용은 제가 참조한 아래 레퍼런스 확인해보시면 좋을 거 같아요 https://springdoc.org/https://colabear754.tistory.com/99https://velog.io/@kjgi73k/Springboot3%EC%97%90-Swagger3%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0 아래는 참고하여 작성한 코드입니다. @Configuration public class SwaggerConfig { @Bean public OpenAPI openAPI(){ return new OpenAPI() .components(new Components()) .info(apiInfo()); } private Info apiInfo() { return new Info() .title("Springdoc 테스트") .description("Springdoc을 사용한 Swagger UI 테스트") .version("1.0.0"); } } @RestController @RequestMapping("/swagger") public class SwaggerController { @Operation(summary = "문자열 반복", description = "파라미터로 받은 문자열을 2번 반복합니다.") @Parameter(name = "str", description = "2번 반복할 문자열") @GetMapping("/returnStr") public String returnStr(@RequestParam String str) { return str + "\n" + str; } @GetMapping("/example") public String example() { return "예시 API"; } @Hidden @GetMapping("/ignore") public String ignore() { return "무시되는 API"; } } NOTE:springdoc.swagger-ui.path에서 swagger url 기본 경로를 설정합니다. 저는 아래와 같이 /swagger로 접속하게끔 했습니다.# SPRINGDOC springdoc.packages-to-scan=com.example.dateanu.rest_api springdoc.default-consumes-media-type= application/json;charset=UTF-8 springdoc.default-produces-media-type= application/json;charset=UTF-8 springdoc.swagger-ui.path=/swagger springdoc.swagger-ui.disable-swagger-default-url=true springdoc.swagger-ui.display-request-duration=true springdoc.swagger-ui.operations-sorter=alpha
-
미해결자바 스프링부트 활용 웹개발 실무용
3강 Swagger 컴파일 에러
swagger 의존성 추가하고 똑같이 코드 작성했는데 오류가 납니다java.lang.IllegalStateException: Failed to introspect Class [kr.co.songjava.configuration.SwaggerConfiguration] from ClassLoader [org.springframework.boot.devtools.restart.classloader.RestartClassLoader@36fd7761] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:361) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:418) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:765) ~[spring-beans-5.3.22.jar:5.3.22] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[na:1.8.0_291] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:764) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:703) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:674) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1670) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:669) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:661) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300) ~[spring-context-5.3.22.jar:5.3.22] at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:867) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:855) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:842) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:782) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.3.jar:2.7.3] at kr.co.songjava.ExampleSpringApplication.main(ExampleSpringApplication.java:10) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_291] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_291] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_291] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_291] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.7.3.jar:2.7.3] Caused by: java.lang.NoClassDefFoundError: springfox/documentation/spring/web/plugins/Docket at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_291] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_291] at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_291] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467) ~[spring-core-5.3.22.jar:5.3.22] ... 26 common frames omitted Caused by: java.lang.ClassNotFoundException: springfox.documentation.spring.web.plugins.Docket at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_291] at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_291] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_291] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_291] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_291] at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.7.3.jar:2.7.3] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291] ... 30 common frames omitted오류 코드가 이렇게 나오는데 어느부분이 문제일까요?? 부트는 2.4.0버전이고 swagger 2.9.2입니다
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
swagger용 데코레이터 작성 방법
swagger를 위한 정보를 decorator를 통해 추가하다보면 ApiOperation 뿐만 아니라 ApiBody, ApiResponse 등 다양한 decorator가 추가되고 이에 대한 인자를 객체로 만들어서 넣어주는 과정에서 코드가 굉장히 지저분해지고, decorator에 들어가는 객체들에 대한 정보 관리가 어려워 지는 거 같습니다 . 이런 경우에 커스텀 데코레이터를 만들어서 하나로 합쳐서 사용하고 싶은데 이러한 커스텀 테코레이터에 대해서 간단하게 작성방법을 강의영상으로 추가해주실 수 있을 지 문의 드립니다.
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
안녕하세요 :) 스웨거 관련 질문이 있습니다!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 :) 강의해 주신 내용을 기반으로 소켓을 이용한 실 서비스를 구현해 보고 있는데요. 다름이 아니라 소켓 부하 테스트를 해보니 처리 못하는 요청 건수가 많아, NodeJS에서 기본적으로 제공해 주는 프로파일링을 해보았고, 그 결과 스웨거 프레임워크가 상당히 많은 CPU 리소스를 잡고 있는 것을 확인했습니다. (물론 사용 중인 AWS EC2의 사양이 낮기도 합니다.) 강의 중에 스웨거 다소 무겁다고 하셨었는데.. 실제로 체감해 보니, 스웨거가 왜 이렇게 많은 CPU를 차지하는 지, 그리고 강사님께서는 왜 무겁다고 하셨는 지 근본적인 원인이 궁금해졌습니다! 스웨거 단점을 인터넷에 찾아보니 무겁다는 측면에 대해서는 크게 언급이 없어 여기에 질문을 남깁니다! 최대한 기술적인 측면에서 답변을 해주시면 정말 감사하겠습니다!
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
Swagger 사용 관련 질문이 있습니다.
안녕하세요 제로초님! 제가 swagger를 이용해서 api들을 정리 및 테스트를 해볼려고 하는데 잘 되지가 않아서 질문드립니다. /** * @swagger * /user: * get: * tags: * description: 유저 데이터 조회 및 유저의 Post, Following, Follower 조회 * produces: * - application/json * parameters: * - in: user * name: id * description: 반드시 로그인이 되있는 상태에서 call 해야 user data 조회 가능 * schema: * type: object * properties: * name: * type: number * responses: * 200: * description: 유저 조회 성공 / 또는 조회 실패(null) */ router.get("/", async (req, res, next) => { // GET /user try { if (req.user) { const fullUserWithoutPassword = await User.findOne({ where: { id: req.user.id }, attributes: { exclude: ["password"], }, include: [ { model: Post, attributes: ["id"], }, { model: User, as: "Followings", attributes: ["id"], }, { model: User, as: "Followers", attributes: ["id"], }, ], }); res.status(200).json(fullUserWithoutPassword); } else { res.status(200).json(null); } } catch (error) { console.error(error); next(error); } }); 제가 get.axios("/user")를 swagger로 정리 및 테스트 할려고 하는데 계속 respond로 null이 뜹니다. 아무래도 제가 swagger 코드를 잘못친거 같은데 이 여기에서는 어떻게 swagger를 작성해야 될까요?
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
postman 응답 처럼 swagger 에서도 success 를 추가할수 없을까요?
export class ResultDto<T> { @ApiProperty() success: boolean; @ApiProperty() data: T } // ---- cats.controller.ts @ApiResponse({ type: ResultDto<ReadOnlyCatDto> }) @Post() async signUp(@Body() body: CatRequestDto) { return await this.catsService.signUp(body); } 이런 식으로 단순하고 typescript 의 제네릭으로 해봤는데 안되어 질문들입니다.
-
미해결Slack 클론 코딩[백엔드 with NestJS + TypeORM]
swagger관련 질문있습니다
https://github.com/nestjs/swagger/issues/1006 여기있는 문제와 완전히 동일한 문제가생겨서 swagger문서가 나오지않고있습니다. 답변에 나온대로 헬멧 지워도보고 헬멧위로 올려도봤지만 계속 css와 js파일이 https로 불러와지고있습니다. 로컬환경에서는 문서가 잘 나오는데 ec2에 올리면 https로 불러와지네요.. 다른점이 찾기위해 로컬에 보내는 요청과 ec2에 보내는 요청을 비교해봤는데 로컬에서는 Referrer Policy가 strict-origin-when-cross-origin으로 설정되어있고 ec2에는 no-referrer로 설정되어있습니다. 혹시 이게 문제라면 어떤방식으로 접근하면 좋을지 조언 부탁드려도 될까요?