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
Only classes in com.wordnik are properly emitted in model #46
Comments
I didn't realize this was still in the core! Looking into alternatives to it and will get back to you soon. |
Yikes! Thanks for reporting this. |
btw - here's a possible fix if you want it. Worked well for my case: Xeralux@8dac1cf |
@geeksville that'll work but we probably want to externalize this to make it configurable in swagger. |
Opened issue 51 which I believe is related to this issue and can possibly resolve this issue along the way. |
This is addressed in the 1.1-spec branch: https://github.com/wordnik/swagger-core/tree/1.1.0-spec You can configure the package in you web.xml through an init-param: <init-param>
<param-name>api.model.packages</param-name>
<param-value>com.your.project</param-value>
</init-param> This isn't typically needed--there is a default exclusion criteria which passes all the unit tests in |
pushed to master and released in 1.1.0. You can take the default filtering which is sensible--or put your own in web.xml or via programmatic configuration in the TypeUtil: |
Hi,
I'm using your super cool library and I've noticed a small problem. The TypeUtil class filters emitted model classes to com.wordnik.*. This is undoubtably done to avoid emitting lots of uninteresting classes in java foo etc... And I agree that this sort of 'whitelist' approach is better than a backlist. Unfortunately I do have some interesting classes which I'd like to have properly emitted when they are referenced from other model objects.
How do you recommend doing this? TypeUtil is a singleton kinda deep in the bowels. My first thought was to make a new public var of whitelistPackages, and default that var to "com.wordnik.". This would allow 'advanced' users to change that should they so wish. If this is fine with you I'll make such a change and send a pull request. For reference, here's my current hackish way of making things go:
The text was updated successfully, but these errors were encountered: