package org.rakam.server.http;

import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
import org.rakam.server.http.annotations.ApiParam;

public class SwaggerJacksonAnnotationIntrospector extends AnnotationIntrospector {
    @Override
    public Version version() {
        return null;
    }

    @Override
    public String findImplicitPropertyName(AnnotatedMember member) {
        ApiParam annotation = member.getAnnotation(ApiParam.class);
        if (annotation != null && annotation.name() != "") {
            return annotation.name();
        } else {
            return super.findImplicitPropertyName(member);
        }
    }
}

@@ -188,22 +188,170 @@
 nnotated
-Member
+;%0Aimport com.fasterxml.jackson.databind.introspect.AnnotatedMember;%0Aimport io.swagger.annotations.ApiModel;%0Aimport io.swagger.annotations.ApiModelProperty
 ;%0Aimport
@@ -396,16 +396,62 @@
 Param;%0A%0A
+import javax.xml.bind.annotation.XmlElement;%0A%0A
 public c
@@ -924,16 +924,16 @@
 ember);%0A
-
         
@@ -939,11 +939,989 @@
  %7D%0A    %7D
+%0A%0A    @Override%0A    public Boolean hasRequiredMarker(AnnotatedMember m) %7B%0A        ApiParam apiParam = m.getAnnotation(ApiParam.class);%0A        if(apiParam !=null) %7B%0A            return apiParam.required();%0A        %7D%0A%0A        ApiModelProperty ann = m.getAnnotation(ApiModelProperty.class);%0A        if (ann != null) %7B%0A            return ann.required();%0A        %7D%0A        XmlElement elem = m.getAnnotation(XmlElement.class);%0A        if (elem != null) %7B%0A            if (elem.required()) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%0A    @Override%0A    public String findPropertyDescription(Annotated a) %7B%0A        ApiModel model = a.getAnnotation(ApiModel.class);%0A        if (model != null && !%22%22.equals(model.description())) %7B%0A            return model.description();%0A        %7D%0A        ApiModelProperty prop = a.getAnnotation(ApiModelProperty.class);%0A        if (prop != null) %7B%0A            return prop.value();%0A        %7D%0A        return null;%0A    %7D
 %0A%7D%0A

add required marker for @ApiParam