I found out the issue I was having in a similar situation. Apparently the 
problem with my original design was that I was extending 
BaseApiListingResource on the same class where I was trying to implement 
ReaderListener. For whatever reason (feel free to comment if you know why) 
the ReaderListenerwasn't working whenever I extend BaseApiListingResource. 
If I implement ReaderListener on a class that doesn't extend 
BaseApiListingResource then *beforeScan* and *afterScan* work just fine.


According to the code above that wasn't the case here, but I figured I 
would post it just in case it helped or if the actual code was different.

On Friday, April 28, 2017 at 12:57:37 PM UTC-4, Bryan Nelson wrote:
>
>
> Hi Alex,
>
> I'm having a similar issue...did you ever get this figured out?
>
> Thanks!
>
> On Wednesday, September 7, 2016 at 9:33:57 AM UTC-4, [email protected] 
> wrote:
>>
>> I have inserted a ReaderListener to see whether I can change the 
>> duplicate operationId values generated in my inherited classes. The 
>> ReaderListener is in the same package where my scanned @Api classes are.
>>
>> All it currently does is wait for the breakpoint to be hit:
>>
>> public class MyListener implements ReaderListener {
>>  static private Logger log = Logger.getLogger(MyListener.class.getName
>> ());
>>
>>
>>  @Override
>>  public void beforeScan(Reader reader, Swagger swagger) {
>>  }
>>
>>
>>  @Override
>>  public void afterScan(Reader reader, Swagger swagger) {
>>    final Map<String, Model> definitions = swagger.getDefinitions();
>>  
>>    log.info("Definitions: " + definitions.size()); //breakpoint
>>  }
>>
>>
>> }
>>
>> When I call the swagger.json URL, the swagger description is generated 
>> from the annotations in the scanned classes, but the ReaderListener is 
>> never executed.
>> I also tried to add @SwaggerDefinition, but that didn't help.
>>
>> Any hints on how to make swagger-jersey-jaxrs execute the ReaderListener?
>>
>> Is there any documentation for the Reader or Swagger classes or for the 
>> Model interface?
>>
>

-- 
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