Created issue: https://github.com/swagger-api/swagger-inflector/issues/135
On Thursday, 21 July 2016 22:28:07 UTC+2, Arian Kuschki wrote:
>
> Hi Tony,
>
> curl and browser are the same:
>
>
> Method I implemented:
> curl -s -H "Accept: application/json" http://
> 104.155.88.210:8085/v1/customers/1/campaigns
>
> returns
>
> {"name":"dodo","callouts":[],"negativeKeywords":[]}
>
> but
>
> curl -s http://104.155.88.210:8085/v1/customers/1/campaigns
>
> returns
> <Campaign><id/><name>dodo
> </name><dailyBudget/><callouts/><startDate/><endDate/><partnerRadius/><negativeKeywords/><active/></Campaign>
>
>
> Mocked method returns json even without "Accept" header:
>
> curl -s http://104.155.88.210:8085/v1/customers/1/campaigns/1
>
> returns
>
> {"id":0,"name":"string","dailyBudget":0,"callouts":["string"],"startDate":
> "2015-07-20","endDate":"2015-07-20","partnerRadius":1.1,"negativeKeywords"
> :["id"0,"text","string"],"active":true}
>
>
>
> On Thursday, 21 July 2016 22:21:21 UTC+2, tony tam wrote:
>>
>> I think you’re talking about in the browser only? Or are you talking
>> about when calling via curl, etc?
>>
>> On Jul 21, 2016, at 1:13 PM, Arian Kuschki <[email protected]>
>> wrote:
>>
>> Hi,
>> I use swagger-inflector and swagger-codegen to create a java jersey2 app.
>> All my unimplemented methods are mocked by inflector and return json. But
>> the methods I implement return xml by default. The "@Produces" annotation
>> seems to be ignored. The only way to make them return json is to set the
>> "Accept" header with every request.
>>
>> How can I set the output format of all controller methods to json?
>>
>> Cheers,
>> Arian
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Swagger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.