* 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
* 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>
* 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
* add test cases to cover different collection format
* add space params to retrofit 1.x
* add space params to retrofit 2.x
* rename url to localVarUrl
* fix exception in haskell servant
* feat(java-jersey2): Adding http response headers and making example compilable
* feat(java-jersey2): Updating pet project
* feat(java-jersey2): Removing uncessary lines from Readme
* feat(java-jersey2): Updating pet projects
* feat(java-jersey2): Updating pet projects
* add group parameter support to php template
* more update for group parameter
* fix call to protect function
* fix missing $
* update based on feedback
* create fake endpoint to test group parameters
* sync fake petstore spec v2, v3
* fix php doc for group parameters
* update petstore samples
* update fake petstore spec v2
* update petstore samples
* fix spec and update samples
* fix schema/definition name as 'file'
* update samples
* Trigger CI due to previous Shippable race condition
* add fix with toModelName(openAPIType)
* update tests for file schema/definition name
* Update 3.0 test spec
* update samples
* update samples for jaxrs-cxf
* Trigger CI due to previous Shippable race condition
* add back explode
* Closes#5863
The "dateLibrary" option for java, sadly, sets a mustache value "java8". This change updates this so that "java" in the mustache
libraries means what it should mean - use all java8 classes. In this case, there's no need for the third party Base64 library
as java8's JDK has this built in. In my view, the "dateLibrary" should be deprecated but that should be a separate PR.
* Closes#5954
built and ran tests/samples
When a spec defines a Model at the top level that is a non-aggretate type (such
as string, number or boolean), it essentially represents an alias for the simple
type. For example, the following spec snippet creates an alias of the boolean
type that for all intents and purposes acts just like a regular boolean.
definitions:
JustABoolean:
type: boolean
This can be modeled in some languages through built-in mechanisms, such as
typedefs in C++. Java, however, just not have a clean way of representing this.
This change introduces an internal mechanism for representing aliases. It
maintains a map in DefaultCodegen that tracks these types of definitions, and
wherever it sees the "JustABoolean" type in the spec, it generates code that
uses the built-in "Boolean" instead.
This functionality currenlty only applies to Java, but could be extended to
other languages later.
The change adds a few examples of this to the fake endpoint spec for testing,
which means all of the samples change as well.
* Updating samples after #5232.
* Fix tests after #5232.
* Fix Javascript client tests.
* JaxRS server: set serverPort only when not given from outside.
* Update JaxRS sample creator scripts to fix serverPort.
* Preliminary test fix for JaxRS server generators.
* Updating samples for JaxRS with Jersey1/2.
* Updating JaxRS samples again.
* [feign] add threetenbp support for feign clients
* [okhttp] add threetenbp support for okhttp clients
* [jersey] add threetenbp support for jersey clients
* [retrofit2] add threetenbp support for retrofit2 clients
* [spring] add threetenbp support for spring generators
* add a workaround in tests for a bug in the petstore
The petstore doesn't manage fractional digits of dates correctly when there are less than 3