Skip to content

[Java][okhttp] Inheritance support #6636

Merged
wing328 merged 2 commits intoswagger-api:masterfrom
konopski:inheritance_support_java_client_okhttp_gson
Nov 22, 2017
Merged

[Java][okhttp] Inheritance support #6636
wing328 merged 2 commits intoswagger-api:masterfrom
konopski:inheritance_support_java_client_okhttp_gson

Conversation

@konopski
Copy link
Copy Markdown
Contributor

@konopski konopski commented Oct 8, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming langauge.

Description of the PR

Inheritance support for okhttp with gson parser.
@cbornet Can you please take a look?

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Oct 10, 2017

Similar work has been done before: #4729

cc @bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet

classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment issue

return o.toString().replace("\n", "\n ");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid this unwanted space ?

konopski added a commit to konopski/swagger-codegen that referenced this pull request Oct 11, 2017
@konopski
Copy link
Copy Markdown
Contributor Author

Sorry, this PR is getting messy with some old merges and changes from previous branches with retrofit.
I will clean up changes and ask for revision.

@konopski konopski force-pushed the inheritance_support_java_client_okhttp_gson branch from 325e431 to 0655e94 Compare October 11, 2017 09:31
@konopski
Copy link
Copy Markdown
Contributor Author

I cleaned up the changes, including your remarks.
No idea why travis did not pass and how to reproduce the problem locally.

@lukoyanov
Copy link
Copy Markdown
Contributor

lukoyanov commented Oct 13, 2017

No idea why travis did not pass and how to reproduce the problem locally.

Travis build failure is more than likely not related to changes in this PR. It has some issues.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Nov 22, 2017

Travis test passed via https://travis-ci.org/swagger-api/swagger-codegen/builds/305624150

@wing328 wing328 merged commit 0f92bae into swagger-api:master Nov 22, 2017
@wing328 wing328 changed the title Inheritance support java client okhttp gson [Java][okhttp] Inheritance support Nov 23, 2017
eivinhb added a commit to eivinhb/swagger-codegen that referenced this pull request May 2, 2018
…wagger-api#7836)

After fixes for swagger-api#6636 the gson based clients would not compile if the
swagger json did not have any model definitions. This can be the case
if the API only uses simple datastructures for input and output. (int,
String, List, Map etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants