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

Use config.processResponseClass to determine type of returnContainer #215

Merged
merged 4 commits into from Jul 24, 2014

Conversation

@JDiPierro
Copy link
Contributor

commented Jul 3, 2014

Hey,

This change fixes the issue I reported in #214, which was also reported in #164. When using the Java generator for an endpoint with a responseContainer of "List" the returnContainer that's passed to the template was improperly being filled in with "Array".

In theory this may have been an issue in more than just the Java generator since the base Codegen was where the issue resides. When populating the returnContainer the raw substring from operation.responseClass was being used rather than running that substring through config.processResponseClass(...).

I added a CodegenTest class with a single test that uses the BasicJavaGenerator and checks the returnContainer outputted from apiToMap. The test failed in the initial commit since "Array" was being returned and passes after the second commit. The change broke 2 tests that I fixed in the final commit.

This is my first time working with Scala so please make sure that my change to the failing tests was correct. The tests were expecting the raw string "List" but after my change an Option of Some("List") is returned instead.

Thank you!
JD

fehguy added a commit that referenced this pull request Jul 24, 2014
Use config.processResponseClass to determine type of returnContainer
@fehguy fehguy merged commit 8708303 into swagger-api:master Jul 24, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.