Hi Tony,

Can you help me in configuring SwaggerSpecFilter in SPringBoot application? 

I tried using FilterFactory.setFilter (new MySwaggerFiler());

But it didn't help.

On Friday, March 28, 2014 at 9:41:32 PM UTC+5:30, Ron R wrote:
>
> Hi Wendy, 
>
> Check 
> https://github.com/wordnik/swagger-core/blob/master/samples/java-jaxrs/src/main/java/com/wordnik/swagger/sample/util/ApiAuthorizationFilterImpl.java.
>  
>
>
> Don't forget to define the filter in your web.xml (check the sample). 
> On Mar 28, 2014 7:06 PM, "Wendy Huang" <[email protected] <javascript:>> 
> wrote:
>
>> Hi Tony,
>>
>> This sounds great! Do you have an example or document to show how  
>> SwaggerFilter works in Java?
>>
>> Thanks,
>> Wendy
>>
>>
>> On Thursday, March 27, 2014 3:11:06 PM UTC-7, tony tam wrote:
>>>
>>> Yes, this is precisely the purpose of the SwaggerFilter.  Take a look at 
>>> this unit test as an example.
>>>
>>> https://github.com/wordnik/swagger-core/blob/develop/
>>> modules/swagger-core/src/test/scala/filter/SpecFilterTest.scala#L45
>>>
>>> Which is testing the following filter:
>>>
>>> class SecretParamFilter extends SwaggerSpecFilter {
>>>   override def isOperationAllowed(operation: Operation,
>>>     api: ApiDescription,
>>>     params: java.util.Map[String, java.util.List[String]],
>>>     cookies: java.util.Map[String, String],
>>>     headers: java.util.Map[String, java.util.List[String]]): Boolean = 
>>> true
>>>
>>>   override def isParamAllowed(parameter: Parameter,
>>>     operation: Operation, 
>>>     api: ApiDescription, 
>>>     params: java.util.Map[String, java.util.List[String]], 
>>>     cookies: java.util.Map[String, String], 
>>>     headers: java.util.Map[String, java.util.List[String]]): Boolean = {
>>>     if(parameter.paramAccess == Some("secret")) false
>>>     else true
>>>   }
>>> }
>>>
>>> Tony
>>>
>>> On Thursday, March 27, 2014 2:25:31 PM UTC-7, Wendy Huang wrote:
>>>>
>>>>
>>>> Hi Tony,
>>>>
>>>> Thanks! Is it possible to make this attribute as configuration 
>>>> parameter, so we can enable or disable when start the application?
>>>>
>>>> Thanks,
>>>> Wendy
>>>>
>>>> On Thursday, March 27, 2014 12:26:39 PM UTC-7, tony tam wrote:
>>>>>
>>>>> 1.3.3-SNAPSHOT has a hidden attribute:
>>>>>
>>>>> https://github.com/wordnik/swagger-core/blob/develop/
>>>>> modules/swagger-annotations/src/main/java/com/wordnik/
>>>>> swagger/annotations/ApiOperation.java#L74
>>>>>
>>>>> On Thursday, March 27, 2014 12:05:21 PM UTC-7, Wendy Huang wrote:
>>>>>>
>>>>>> Hi Ron,
>>>>>>
>>>>>> We use swagger-jaxrs_2.10 1.3.2 version. API hide for everyone is 
>>>>>> good enough.
>>>>>>
>>>>>> Thanks,
>>>>>> Wendy
>>>>>>
>>>>>> On Wednesday, March 26, 2014 9:17:32 PM UTC-7, Ron R wrote:
>>>>>>>
>>>>>>> Which Swagger library do you use to generate the documentation? 
>>>>>>>
>>>>>>> Should the API be hidden to everyone or based on some condition? 
>>>>>>> On Mar 27, 2014 2:39 AM, "Wendy Huang" <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> We have a requirement to hide some API display on swagger UI. Is 
>>>>>>>> there a way to do that?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Wendy
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> 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] <javascript:>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
On Friday, March 28, 2014 at 9:41:32 PM UTC+5:30, Ron R wrote:
>
> Hi Wendy, 
>
> Check 
> https://github.com/wordnik/swagger-core/blob/master/samples/java-jaxrs/src/main/java/com/wordnik/swagger/sample/util/ApiAuthorizationFilterImpl.java.
>  
>
>
> Don't forget to define the filter in your web.xml (check the sample). 
> On Mar 28, 2014 7:06 PM, "Wendy Huang" <[email protected] <javascript:>> 
> wrote:
>
>> Hi Tony,
>>
>> This sounds great! Do you have an example or document to show how  
>> SwaggerFilter works in Java?
>>
>> Thanks,
>> Wendy
>>
>>
>> On Thursday, March 27, 2014 3:11:06 PM UTC-7, tony tam wrote:
>>>
>>> Yes, this is precisely the purpose of the SwaggerFilter.  Take a look at 
>>> this unit test as an example.
>>>
>>> https://github.com/wordnik/swagger-core/blob/develop/
>>> modules/swagger-core/src/test/scala/filter/SpecFilterTest.scala#L45
>>>
>>> Which is testing the following filter:
>>>
>>> class SecretParamFilter extends SwaggerSpecFilter {
>>>   override def isOperationAllowed(operation: Operation,
>>>     api: ApiDescription,
>>>     params: java.util.Map[String, java.util.List[String]],
>>>     cookies: java.util.Map[String, String],
>>>     headers: java.util.Map[String, java.util.List[String]]): Boolean = 
>>> true
>>>
>>>   override def isParamAllowed(parameter: Parameter,
>>>     operation: Operation, 
>>>     api: ApiDescription, 
>>>     params: java.util.Map[String, java.util.List[String]], 
>>>     cookies: java.util.Map[String, String], 
>>>     headers: java.util.Map[String, java.util.List[String]]): Boolean = {
>>>     if(parameter.paramAccess == Some("secret")) false
>>>     else true
>>>   }
>>> }
>>>
>>> Tony
>>>
>>> On Thursday, March 27, 2014 2:25:31 PM UTC-7, Wendy Huang wrote:
>>>>
>>>>
>>>> Hi Tony,
>>>>
>>>> Thanks! Is it possible to make this attribute as configuration 
>>>> parameter, so we can enable or disable when start the application?
>>>>
>>>> Thanks,
>>>> Wendy
>>>>
>>>> On Thursday, March 27, 2014 12:26:39 PM UTC-7, tony tam wrote:
>>>>>
>>>>> 1.3.3-SNAPSHOT has a hidden attribute:
>>>>>
>>>>> https://github.com/wordnik/swagger-core/blob/develop/
>>>>> modules/swagger-annotations/src/main/java/com/wordnik/
>>>>> swagger/annotations/ApiOperation.java#L74
>>>>>
>>>>> On Thursday, March 27, 2014 12:05:21 PM UTC-7, Wendy Huang wrote:
>>>>>>
>>>>>> Hi Ron,
>>>>>>
>>>>>> We use swagger-jaxrs_2.10 1.3.2 version. API hide for everyone is 
>>>>>> good enough.
>>>>>>
>>>>>> Thanks,
>>>>>> Wendy
>>>>>>
>>>>>> On Wednesday, March 26, 2014 9:17:32 PM UTC-7, Ron R wrote:
>>>>>>>
>>>>>>> Which Swagger library do you use to generate the documentation? 
>>>>>>>
>>>>>>> Should the API be hidden to everyone or based on some condition? 
>>>>>>> On Mar 27, 2014 2:39 AM, "Wendy Huang" <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> We have a requirement to hide some API display on swagger UI. Is 
>>>>>>>> there a way to do that?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Wendy
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> 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] <javascript:>
>> .
>> 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.

Reply via email to