27 Commits

Author SHA1 Message Date
Renato Mameli
bfa26ea6be
Add missing underscores for PascalCase enum values #4837 (#18594)
Co-authored-by: Renato Mameli <renato.mameli@teamviewer.com>
2024-05-21 15:29:34 +08:00
William Cheng
809c90aa24
Use unescaped media type in java native client (#17872)
* use unescaped media type in java native client

* add tests
2024-02-16 10:17:08 +08:00
martin-mfg
9afea50cab
use map/array model class only if it is generated (#17612)
* fix

* tests

* generate samples

* refactor
2024-01-29 21:35:21 +08:00
martin-mfg
64f2cad9e8
fix #17258 - use model class only if it is generated (#17490)
* fix  #16797 and #15796 spring child constructor missing parent params

* root cause and update the DefaultCodegen.java to add missing property when with multi inheritance

* rollback SpringCodegen.java

* update samples

* rollback with master cause #16992 fixed this issue too

* still using orignal design

* catchup master

* catchup master

* catchup master

* fix

* add tests

---------

Co-authored-by: dabdirb <dabdirb@gmail.com>
2024-01-05 10:30:28 +08:00
martin-mfg
2ca99bdf8e
use model class for request body with additionalProperties (#16613)
* try out simple fix

* add test case

* generate samples
2023-09-23 13:07:53 +08:00
karzang
e299382a42
[Java][Client] Fix handling of 'number' types in oneOf (#16202) 2023-08-06 11:16:50 +08:00
karzang
e9d98666a1
[Java][Client] Fix #12556 Support primitives and arrays in oneOf (#13897)
* [Java][Client] Fix #12556 Support primitives and arrays in oneOf

* Regenerate petstore samples

* Regenerate petstore test samples

* Treat 'BigDecimal' as primtive datatype

* Fix integration tests
2023-06-29 16:46:55 +08:00
William Cheng
6788f43af0
Better handling of Inline schema (#15682)
* skip allOf inline subschema created as $ref

* add option for fallback

* add back atleastonemodel

* add log

* update java, kotlin, js samples

* update tests

* fix native client test

* fix java client errors by regenerating test files

* clean up python

* clean up powershell

* clean up php

* clean up ruby

* update erlang, elixir

* update dart samples

* update ts samples

* update r, go samples

* update perl

* update swift

* add back files

* add back files

* remove outdated test files

* fix test
2023-06-11 15:35:58 +08:00
martin-mfg
b7f2b723aa
[JAVA] fix toUrlQueryString for BigDecimal (#15764)
* add MyImportTest.java

* fix original issue

* fix same issue for native library

* remove MyImportTest

* add test configs

* generate samples (again?)

* generate samples again

* generate samples again, undo pom.xml mistake [amended to retrigger circliCi]
2023-06-08 09:34:06 +08:00
Tiffany Marrel
8a6c708884
[Java] Cleanup documentation (#15300)
* [Java] fix documentation of API authorization in README files

fix hierarchy level + add internal links + align wording across generators

* [Java] fix anchor links in documentation
2023-05-10 14:14:44 +08:00
Beppe Catanese
68b944e6e6
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
2023-02-10 22:20:19 +08:00
William Cheng
4ecb9f4186
[java][native] Fix urlQuery string method in oneOf (#14488)
* better tests, fix oneOf in urlquery string method

* update samples

* update
2023-01-20 01:57:32 +08:00
William Cheng
980062f2bb
Improve Java native, apache-httpclient with better spec (#14109)
* improve java native, apache client with better spec

* fix java native async tests

* regenerate java native tests
2022-11-24 21:48:09 +08:00
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
William Cheng
7370c4d3f8 update java samples 2022-03-25 00:42:07 +08:00
William Cheng
33bce99b8e
Avoid using import mapping in model generation (#11217)
* remove import mapping logic in model generation, better handle of file, list

* add new files for file, list

* fix some tests

* update tests, doc

* skip file as reserved word in feign client

* add new files

* remove file from reserved word list in spring generator
2022-01-16 23:57:53 +08:00
William Cheng
b72eba90cd
[java][okhttp-gson-nextgen] better oneOf implementation (#11146)
* add validJsonObject method

* add check for null

* fix list model generation

* fix optional fields validation

* add tests

* fix variable naming

* update tests

* add fromJson in oneOf, add tests

* convert JSON to static

* remove trailing space

* add fromString methods to all models

* add toJson, fix anyOf template

* remove workarounds

* undo changes to tests

* skip file schema test

* add new file
2021-12-18 23:22:55 +08:00
Justin Black
d4b8ff60a1
[Java] Fixes schema class type booleans for composed schemas (#10334)
* Adds get/setIsString interface to IJsonSchemaValidationProperties

* Adds get/set isNumber interface in IJsonSchemaValidationProperties

* Adds get/set isAnyType in IJsonSchemaValidationProperties

* Adds and uses ModelUtils.isAnyType, adds setTypeProperties

* Adds missing descriptions of isAnyType parameters

* Uses ModelUtils.isAnyType

* Samples regenerated

* Moves isArray handling higher up in fromProperty

* Moves isAnyTypeSchema handling higher up in fromProperty

* Moves isFreeFormObject handling higher up in fromProperty

* Refactors fromProperties, updates tests

* Fixes the fromProperty refactor, tests now pass

* Uses setTypeProperties to set isNumber, isNull, isArray, and isUnboundedInteger

* Sets isAnyType in setTypeProperties

* Sets isMap in setTypeProperties

* Sets property.isPrimitiveType in isFreeFormObject, tweaks if condition order

* Adds fix for JavaClientCodegenTest.testJdkHttpClientWithAndWithoutDiscriminator

* Refactors fromProperty

* Adds updatePropertyForObject updatePropertyForAnyType

* Sets binary and file types to not be strings

* Updates samples

* Adds updatePropertyForString

* Adds testComposedPropertyTypes

* Fixes python test

* Samples updated

* Switches all isAnyTypeSchema usages to ModelUtils.isAnyType

* Refactors model enum handling higher up

* Moves m.dataType assignent higher into fromModel

* Moves m.isNullable setting higher into isModel

* Adds updateModelForComposedSchema

* Further fromModel refactoring, all schema checks are now at the same indentation level

* Further refactors fromModel, adds isTypeObjectSchema block

* Moves addVars into anyType or objectType blocks in fromModel

* Turns off isNullable n isAnyType array

* Fixes typescript CodegenParameers

* Adds updatePropertyForAnyType to typescript-axios so property.isNullable will be false for AnyType

* Adds testComposedModelTypes

* Updates ComposedAnyType schema

* Fixes tests for JavaJAXRSCXF by adding updateModelForObject method

* Updates go and csharp to handle object model differently

* Adds updateModelForAnyType

* Fixes name reference

* Adds testComposedResponseTypes

* Refactoring fromResponse

* Further refactoring of fromResponse

* Uses setTypeProperties in fromResponse

* Tests now pass for testComposedResponseTypes

* Sets COdegenResponse dataType using getTypeDeclaration

* Begins refactoring of fromRequestBody

* Adds updateResponseBodyForPrimitiveType

* Adds all needed type if else blocks in fromRequestBody

* Fixes JavaJAXRSCXFExtServerCodegenTests

* Fixes RubyClientCodegenTests

* Adds fixes for clients that need custom isMap for body parameters

* Ruby broken, samples regened, debugging

* Adds updateRequestBodyForArray, renames updateRequest.. methods

* Samples regenerated

* Removes changes from Ruby generator

* Reverts RubyClientCodegen.java

* Reverts changes to GoClientCodegen.java

* Reverts PowerShellClientCodegen.java

* Reverts CrystalClientCodegen.java

* Removes updateRequestBodyForObject from JavaCXFServerCodegen.java

* Adds comment about refed models

* Tweaks made to fromProperties to add an explanatory comment

* Updates RustServer to have ByteArray request bodies not be strings

* Sets types in fromFormProperty

* Adds testComposedRequestBodyTypes

* Fixes when validation syncing is done in syncValidationProperties

* Removes redundant validation code from fromParameter

* Moves parameter inX setting higher up before schema logic in fromParameter

* More refactoring in fromParameter, uses early return to reduce levels of indentation

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForArray

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForObject

* Removes setParameterBooleanFlagWithCodegenProperty from  updateRequestBodyForPrimitiveType

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForMap

* Removes setParameterBooleanFlagWithCodegenProperty from addBodyModelSchema

* Removes setParameterBooleanFlagWithCodegenProperty from fromFormProperty

* Refactors parameter array handling code into fromFormProperty

* Simplifies fromRequestBodyToFormParameters

* Removes setParameterBooleanFlagWithCodegenProperty from fromParameter

* Adds deprecated docstring to setParameterBooleanFlagWithCodegenProperty

* Refactors ModelUtils.isFileSchema out of string schema check

* Removes ModelUtils.isFileSchema from RustServer updateRequestBodyForString

* Improves comment text

* Fixes RustServer uuid type setting for CodegenParameter

* Removes unneeded parens

* Fixes array property examples

* Removes unused code

* Renames variable to itemsProperty

* Adds testComposedRequestQueryParamTypes

* Adds updatePropertyForAnyType to rustserver will not have changed model properties

* Hoists arrayInnerProperty._enum into parameter for html2 generator

* Moves turning string type off into the codegen files

* Adds two more missing locations in rustserver

* Moves addVarsRequiredVarsAdditionalProps into anytype and objecttype handling

* More refactoring of where addVarsRequiredVarsAdditionalProps is used

* Samples regenerated
2021-09-27 16:12:40 -07:00
Artem
d68d65ce00
Fix java examples (#10257)
* TAP-655 fix examples java

* update samples
2021-09-02 11:08:35 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
Tyler Ballast
f5151de9fc
Add whitespace to SDK documentation where necessary (#8919)
* Add a space between table title and the line above it to resolve issues when translating markdown to asciidoc

* Regenerate Samples

Co-authored-by: Tyler Ballast <tyler.ballast@reportix.com>
Co-authored-by: tballast <tyler.ballast@gmail.com>
2021-03-08 21:40:54 +08:00
Thomas Hervé
616b44f3b1
Improve generated Java examples (#8012)
* Add basic types imports to generated examples

This adds an extension to include basic types imports to generated Java
examples.

* Make some fixes to example generation

* Generate OffsetDatetime correctly

* Create a useful sample for enums, regenerate samples

* Fix BigDecimal as well
2020-11-26 18:14:26 +08:00
Thomas Hervé
14ff8e0ffd
Remove links to basic types in java API docs (#7989)
* Remove links to basic types in java API docs

This removes (most) wrong links to basic types in Java API docs.

* Regenerate some more samples
2020-11-23 16:24:31 +08:00
bgong-mdsol
8cd52033e4
[Java][Native] added WithHttpInfo method for async-native (#6903)
* [java-asyncNative] add withHttpInfo

* update api template for async-native
2020-07-17 15:30:02 +08:00
bgong-mdsol
8400d4c6f9
java-native added WithHttpInfo (#6704)
remove /t
2020-06-22 16:15:11 +08:00
Jochen Schalanda
32adeddd8f
Fix usage of javax.annotation (#6645)
* Fix usage of javax.annotation:javax.annotation-api

* Regenerate samples

```
bin/generate-samples.sh bin/configs/java-* bin/configs/jaxrs-* bin/configs/spring-* bin/configs/kotlin-* bin/configs/other/java-* bin/configs/other/jaxrs-* bin/configs/other/kotlin-* bin/configs/other/openapi3/jaxrs-cxf-client.yaml bin/configs/other/openapi3/kotlin-*
```
2020-06-14 17:01:18 +08:00
Ukonn Ra
f4fa00fefa
Add async native Java Client (#4721)
* Add async native Java Client

* UPDATE: Reformat the samples

* test java native async in drone.io

* update test count

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-03 16:06:18 +08:00