Skip to content

Commit

Permalink
Feat: Swagger용 Multipart -> Json 컨버터 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
tioon committed May 3, 2024
1 parent 764c6bd commit e35d9fb
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.web.baebaeBE.global.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
import org.springframework.stereotype.Component;

import java.lang.reflect.Type;

@Component
public class MultipartJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter {

protected MultipartJackson2HttpMessageConverter(ObjectMapper objectMapper) {
super(objectMapper, MediaType.APPLICATION_OCTET_STREAM);
}

@Override
public boolean canWrite(Class<?> clazz, MediaType mediaType){
return false;
}

@Override
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType){
return false;
}

@Override
protected boolean canWrite(MediaType mediaType){
return false;
}
}

0 comments on commit e35d9fb

Please sign in to comment.