Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No easy way to set scanAllResources in configuration, such as BeanConfig #1884

Closed
jasonchaffee opened this issue Aug 16, 2016 · 4 comments
Closed

Comments

@jasonchaffee
Copy link

It would be nice to be able to set scanAllResources so that we don't need the @Api annotation and it will just use the @path annotation. In particular, it would be nice to be able to do this on BeanConfig.

@fehguy
Copy link
Contributor

fehguy commented Dec 24, 2016

This is supported for web.xml configurations:

https://github.com/swagger-api/swagger-samples/blob/master/java/java-jaxrs-no-annotations/src/main/webapp/WEB-INF/web.xml#L52

You can easily subclass BeanConfig to add this support. Better yet, consider adding a PR to BeanConfig and it can be merged.

@fehguy fehguy closed this as completed Dec 24, 2016
@vanta
Copy link
Contributor

vanta commented Aug 28, 2017

Not so easy as ReaderConfig has package-private access... I can implement ReaderListener with:

    @Override
    public void beforeScan(Reader reader, Swagger swagger) {
        ((DefaultReaderConfig) reader.getConfig()).setScanAllResources(true); 
    }

but this is dirty...

Any ideas how to do it better without dealing with servlet properties (I don't have access to them)?

@chaodhib
Copy link

Please reopen this issue: it should be possible to easily set up that variable, even when using Swagger's BeanConfig.

@vanta
Copy link
Contributor

vanta commented Sep 15, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants