ryankennedy / swagger-jaxrs-doclet

Apache License 2.0
87 stars 136 forks source link

Add produces and consumes #79

Open iamcrunch opened 10 years ago

iamcrunch commented 10 years ago

I could not get the tests to run in my environment, so I might need help if this change breaks tests. Even if they don't break, this change is untested in this PR.

iamcrunch commented 10 years ago

Test failures are:

Argument(s) are different! Wanted:
recorder.record(
    <any>,
    ApiDeclaration{apiVersion=0, swaggerVersion=1.1, basePath=http://localhost:8080, resourcePath=/jackson, apis=[Api{path=/jackson, description=, operations=[Operation{httpMethod=GET, consumes=null, produces=null, nickname=get, responseClass=response, parameters=null, responseMessages=null, summary=null, notes=null}, Operation{httpMethod=POST, consumes=null, produces=null, nickname=create, responseClass=Response, parameters=[ApiParameter{paramType=body, name=payload, description=null, dataType=payload}], responseMessages=null, summary=null, notes=null}]}], models={response=Model{id=response, properties={visibleField=Property{type=string, description=null, containerOf=null, allowableValues=null}, odd-name=Property{type=string, description=null, containerOf=null, allowableValues=null}}}, payload=Model{id=payload, properties={visibleField=Property{type=string, description=null, containerOf=null, allowableValues=null}, odd-name=Property{type=string, description=null, containerOf=null, allowableValues=null}}}}}
);
    at com.hypnoticocelot.jaxrs.doclet.apidocs.JacksonTest.testStart(JacksonTest.java:37)
Actual invocation has different arguments:
recorder.record(
    service.json,
    ResourceListing{apiVersion=0, basePath=http://localhost:8080, apis=[]}
);
    at com.hypnoticocelot.jaxrs.doclet.parser.JaxRsAnnotationParser.writeApis(JaxRsAnnotationParser.java:76)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.hypnoticocelot.jaxrs.doclet.apidocs.JacksonTest.testStart(JacksonTest.java:37)

... Ideas?

iamcrunch commented 10 years ago

(wrong button, accidentally closed)