Skip to content
New issue

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

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

Already on GitHub? # to your account

SwaggerSpecFilter with removingUnreferencedDefinitions, removes definitions within containers (List/Map) #1757

Closed
mtraynham opened this issue Apr 14, 2016 · 2 comments · Fixed by #1758
Assignees

Comments

@mtraynham
Copy link
Contributor

mtraynham commented Apr 14, 2016

The example condition is at (but there are other lines just like it):
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-core/src/main/java/io/swagger/core/filter/SpecFilter.java#L140

if (response.getSchema() != null && response.getSchema() instanceof RefProperty) {

As an example:

public List<Foobar> getAll() {
    ...
}

Will filter out the FooBar definition, as the operation's response is an ArrayProperty which does not extend RefProperty.

public Foobar getAll() {
    ...
}

Retains this property correctly...

@fehguy
Copy link
Contributor

fehguy commented Apr 14, 2016

@mtraynham can you please send a PR with a test case? Would help a lot.

@mtraynham
Copy link
Contributor Author

@fehguy No problem, should be available shortly.

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

Successfully merging a pull request may close this issue.

3 participants