br.com.anteros.jsondoc.springmvc.scanner.builder.SpringRequestBodyBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-JSONDoc-SpringMVC Show documentation
Show all versions of Anteros-JSONDoc-SpringMVC Show documentation
The support for Spring MVC of the jsondoc project.
The newest version!
package br.com.anteros.jsondoc.springmvc.scanner.builder;
import java.lang.reflect.Method;
import org.jsondoc.core.util.JSONDocType;
import org.jsondoc.core.util.JSONDocTypeBuilder;
import org.jsondoc.core.util.JSONDocUtils;
import org.springframework.web.bind.annotation.RequestBody;
import br.com.anteros.jsondoc.core.pojo.ApiBodyObjectDoc;
public class SpringRequestBodyBuilder {
public static ApiBodyObjectDoc buildRequestBody(Method method) {
Integer index = JSONDocUtils.getIndexOfParameterWithAnnotation(method, RequestBody.class);
if (index != -1) {
ApiBodyObjectDoc apiBodyObjectDoc = new ApiBodyObjectDoc(JSONDocTypeBuilder.build(new JSONDocType(), method.getParameterTypes()[index], method.getGenericParameterTypes()[index]));
return apiBodyObjectDoc;
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy