Repository navigation
[JAVA] Add generic okhttp client #24734
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
Open
rar91279
wants to merge
65
commits into
OpenAPITools:master
Choose a base branch
from
rar91279:java-generic-okhttp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+587,628
−47
Open
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
02f432b
[java][okhttp] Add okhttp library supporting Gson, Jackson 2/3 and JS…
rar91279 15b7c37
[java] Rename okhttp-gson user-defined-templates config to match its …
rar91279 f3141fd
[java][okhttp] Add sample configurations for the okhttp library
rar91279 e8f10f9
[java][okhttp] Wire okhttp samples into CI and refresh generator docs
rar91279 cf8eb48
[java][okhttp] Regenerate samples for the okhttp library
rar91279 cafdd93
[java][okhttp] Regenerate samples against a clean build
rar91279 19d6117
[java][okhttp] Fix defects found in review of the new library
rar91279 cafcd91
[java][okhttp] Route the Jackson 3 JsonTypeName import through model.…
rar91279 3ae4290
Update generator docs: Add okhttp library details and support for `us…
rar91279 9e366d6
Merge branch 'master' into java-generic-okhttp
rar91279 1b8663d
[java][okhttp] Adopt generateInsecureTlsHook and the collection-forma…
rar91279 8e3a141
[java][okhttp] Regenerate samples after the master merge and template…
rar91279 98e70bd
[java][okhttp] Address review findings: jsonb additionalProperties, b…
rar91279 b8112c1
[java][okhttp] Regenerate samples for the review fixes
rar91279 0a067d6
[java][okhttp] Fix the defects found in the five-agent sample review
rar91279 beb1c76
[java][okhttp] Regenerate samples for the review fixes
rar91279 ec5c82c
[java][okhttp] Close the okhttp-gson parity gaps: composed fromJson/t…
rar91279 d289677
[java][okhttp] Regenerate samples and port the invoker unit tests
rar91279 b6c18a6
Merge branch 'master' into java-generic-okhttp
rar91279 45083ba
Merge branch 'master' into java-generic-okhttp
rar91279 920a12a
[java][okhttp] Repoint the jackson/jsonb samples off the http-signatu…
rar91279 add7472
Merge branch 'master' into java-generic-okhttp
rar91279 ff57109
[java][okhttp] Fix the defects found in the cubic review of the new l…
rar91279 69abe33
[java][okhttp] Build the jackson3 okhttp samples on JDK 17, not JDK 11
rar91279 b504403
fix from leak analyze of generated:
e9edfc5
fix from leak analysis of generated:
7fbdfd4
Fix missing semicolons in response close calls to ensure proper syntax
2fbd7e4
[java][okhttp] Add Jakarta EL and explicitly handle Bean Validation d…
rar91279 82f8bfe
[java][okhttp] Refactor imports, add unchecked JSON-B instance, impro…
rar91279 49d04be
[java][okhttp] Regenerate the okhttp samples after 82f8bfec184
rar91279 c532a71
[java][okhttp] Fix four JSON-B deserialization validation gaps
rar91279 18a40a3
Merge branch 'master' into java-generic-okhttp
rar91279 60c5734
[java][okhttp] Add the Jackson Joda datatype module to the generated …
rar91279 1aa09f2
[java][okhttp] Delete stale user-defined-templates doc output
rar91279 309e21d
[java][okhttp] Fix two JSON-B additionalProperties serialization defects
rar91279 e373777
[java][okhttp] Fix seven defects found by a live PetClinic parameter …
rar91279 e44851c
Merge branch 'master' into java-generic-okhttp
rar91279 17e8148
[java][okhttp] Keep additionalProperties across toBuilder()
rar91279 9a0e2ab
[java][okhttp] Stop setting useReflectionEqualsHashCode in okhttp con…
rar91279 a3c22df
Merge branch 'master' into java-generic-okhttp
rar91279 f169820
[java][okhttp] Regenerate okhttp-3.1 sample after merging master
rar91279 10b9597
Merge branch 'master' into java-generic-okhttp
rar91279 82795a1
[java][okhttp] Regenerate okhttp samples and docs after merging master
rar91279 4779fb5
[java][okhttp] List okhttp in the useJackson3 option description
rar91279 7ba89f4
[test][swift6] Pin generateAliasAsModel=false in nestedMapRefTypeTest
rar91279 bf46687
[java][okhttp] Serialize JSON header parameter content
rar91279 f71a2c1
[java][okhttp] Escape JavaDoc default values in generated API docs
rar91279 98df026
[java][okhttp] Do not seed addItem/putItem with the container default
rar91279 487aafc
[java][okhttp] Port the two inner-enum fixes from okhttp-gson
rar91279 a70c4fc
[java][okhttp] Update jackson-databind-nullable to 0.2.12
rar91279 c504caf
[java][okhttp] Make Gson oneOf/anyOf TypeAdapters null-safe
rar91279 3c849ef
[java][okhttp] Build the shared serializer eagerly in JSON
rar91279 cf23b9f
[java][okhttp] Detect byte[] responses independently of the serializer
rar91279 07ecf1e
[java][okhttp] Report OAuth token endpoint failures instead of sendin…
rar91279 2459810
[java][okhttp] Pass the token a request was sent with to updateAccess…
rar91279 9406758
[java][okhttp] Emit @XmlEnumValue from the raw enum value
rar91279 f9133eb
[java][okhttp] Serialize byte[] as base64 in the JSON-B variant
rar91279 6ad5274
[java][okhttp] Fall back to the raw body for String results in the JS…
rar91279 6c4821b
[java][okhttp] Omit the openapiFields sets from Jackson models
rar91279 a68f0c0
Fix cubicAI review concerns
rar91279 6a7029a
[java][okhttp] Import Arrays and Map in Jackson models only when used
rar91279 7a3905f
[java][okhttp] Handle JSON-B parents without a discriminator
rar91279 e89845d
Merge branch 'master' into java-generic-okhttp
rar91279 43c475e
[java][okhttp] Validate string enum values excluded by not (port of #…
rar91279 8f955bc
[java][okhttp] Enforce inherited not-enum constraints in Gson models
rar91279 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-3.1-duplicated-operationid | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_1/java/duplicated_operationid.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| validateSpec: false | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: petstore-okhttp-31-do | ||
| hideGenerationTimestamp: "true" | ||
| disallowAdditionalPropertiesIfNotPresent: false | ||
| openapiNormalizer: | ||
| FIX_DUPLICATED_OPERATIONID: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-3.1 | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| validateSpec: false | ||
| nameMappings: | ||
| _type: underscoreType | ||
| type_: typeWithUnderscore | ||
| parameterNameMappings: | ||
| _type: underscoreType | ||
| type_: typeWithUnderscore | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: petstore-okhttp-31 | ||
| hideGenerationTimestamp: "true" | ||
| useOneOfDiscriminatorLookup: "true" | ||
| disallowAdditionalPropertiesIfNotPresent: false | ||
| enumPropertyNaming: legacy | ||
| openapiNormalizer: | ||
| FIX_DUPLICATED_OPERATIONID: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-awsv4signature | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: okhttp-awsv4signature | ||
| hideGenerationTimestamp: "true" | ||
| useOneOfDiscriminatorLookup: "true" | ||
| disallowAdditionalPropertiesIfNotPresent: false | ||
| withAWSV4Signature: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-dynamicOperations | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: petstore-okhttp-dynamicoperations | ||
| hideGenerationTimestamp: "true" | ||
| dynamicOperations: "true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/echo_api/java/okhttp | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: echo-api-okhttp | ||
| hideGenerationTimestamp: "true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-group-parameter | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-group-parameter.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: gson | ||
| artifactId: petstore-okhttp-group-parameter | ||
| hideGenerationTimestamp: "true" | ||
| disallowAdditionalPropertiesIfNotPresent: false | ||
| useSingleRequestParameter: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/echo_api/java/okhttp-gson-user-defined-templates | ||
| library: okhttp-gson | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| hideGenerationTimestamp: "true" | ||
| files: | ||
| README.mustache: | ||
| destinationFilename: info.md | ||
| api_doc.mustache: | ||
| templateType: APIDocs | ||
| destinationFilename: Documentation.md | ||
| pojo.mustache: | ||
| templateType: Model | ||
| folder: modelCopy | ||
| destinationFilename: .java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-jackson-jspecify | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| validateSpec: false | ||
| additionalProperties: | ||
| serializationLibrary: jackson | ||
| artifactId: petstore-okhttp-jackson-jspecify | ||
| hideGenerationTimestamp: "true" | ||
| generateBuilders: true | ||
| openApiNullable: "false" | ||
| useJspecify: true | ||
| typeMappings: | ||
| OffsetDateTime: java.time.Instant | ||
| BigDecimal: java.math.BigDecimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-jackson-nullable-required | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: jackson | ||
| artifactId: nullable-required-okhttp-jackson | ||
| hideGenerationTimestamp: "true" | ||
| useOneOfDiscriminatorLookup: "true" | ||
| disallowAdditionalPropertiesIfNotPresent: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/others/java/okhttp-jackson-oneOf | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_twoPrimitives.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| artifactId: okhttp-jackson-oneOf | ||
| hideGenerationTimestamp: "true" | ||
| serializationLibrary: jackson |
17 changes: 17 additions & 0 deletions
17
bin/configs/java-okhttp-jackson-user-defined-templates.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/echo_api/java/okhttp-jackson-user-defined-templates | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| artifactId: echo-api-okhttp-jackson-user-defined-templates | ||
| hideGenerationTimestamp: "true" | ||
| serializationLibrary: jackson | ||
| files: | ||
| api_doc.mustache: | ||
| templateType: APIDocs | ||
| destinationFilename: .md | ||
| pojo.mustache: | ||
| templateType: Model | ||
| folder: modelCopy | ||
| destinationFilename: .java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-jackson | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| nameMappings: | ||
| _type: underscoreType | ||
| type_: typeWithUnderscore | ||
| parameterNameMappings: | ||
| _type: underscoreType | ||
| type_: typeWithUnderscore | ||
| additionalProperties: | ||
| serializationLibrary: jackson | ||
| openApiNullable: "false" | ||
| defaultToEmptyContainer: "array?|array|map?" | ||
| artifactId: petstore-okhttp-jackson2 | ||
| hideGenerationTimestamp: "true" | ||
| useOneOfDiscriminatorLookup: true | ||
| disallowAdditionalPropertiesIfNotPresent: false | ||
| generateBuilders: true | ||
| removeEnumValuePrefix: true | ||
| enumNameMappings: | ||
| s: LOWER_CASE_S | ||
| S: UPPER_CASE_S | ||
| operationIdNameMappings: | ||
| getArrayOfEnums: getFakeArrayofenums | ||
| fakeHealthGet: getFakeHealth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/okhttp-jackson3-jspecify | ||
| library: okhttp | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| validateSpec: false | ||
| additionalProperties: | ||
| serializationLibrary: jackson | ||
| artifactId: petstore-okhttp-jackson3-jspecify | ||
| hideGenerationTimestamp: "true" | ||
| generateBuilders: true | ||
| useJackson3: "true" | ||
| openApiNullable: "false" | ||
| useJspecify: true | ||
| typeMappings: | ||
| OffsetDateTime: java.time.Instant | ||
| BigDecimal: java.math.BigDecimal |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.