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

Issue 1482 refactor #1611

Merged
merged 13 commits into from
Jan 21, 2016
Merged

Issue 1482 refactor #1611

merged 13 commits into from
Jan 21, 2016

Conversation

frantuma
Copy link
Member

As discussed with @fehguy, PR aims at fixing and references issues #1482 #1384, PR #1397.

It basically allows to configure more than one "Swagger context" (logical concept including SwaggerConfig, Swagger initial info and used Scanner instance) in same JVM and same web application, one for each configured servlet/servletConfig.

An example of "multi context" setup can be find in samples project PR swagger-api/swagger-samples#46
where a "swagger.context.id" initParam is provided for each separate "swagger context" instance (see sample web.xml)

Approach is sub-optimal, but as discussed quite some additional refactor would be needed to accomplish a nicer solution, with quite high risk related to compatibility.

@webron
Copy link
Contributor

webron commented Jan 19, 2016

As @fehguy mentioned, I assume this doesn't solve #1103. I think it's fine if it solves the other issues, and the solution to #1103 will be a separate one (there's a pending PR which may solve it, I think).

@frantuma
Copy link
Member Author

@webron it should actually possibly solve it, I just updated last remaining unchecked ref to context (kind of quick fix, ReaderConfig still only configurable via context), but tests and samples would need to be run/checked to confirm

@fehguy
Copy link
Contributor

fehguy commented Jan 21, 2016

I've verified this works. There is a slight change in usage though--as shown in the samples, this:

context.setAttribute("swagger", swagger);

has been replaced with this:

new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);

We'll update the release notes

@fehguy fehguy merged commit 8031d51 into swagger-api:master Jan 21, 2016
@fehguy fehguy added this to the v1.5.7 milestone Jan 21, 2016
@frantuma frantuma deleted the issue_1482_refactor branch January 21, 2016 08:34
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

Successfully merging this pull request may close these issues.

4 participants