138 Commits

Author SHA1 Message Date
Sebastien Rosset
f7f41410e7
[codegen][python-experimental] Composed schema with additionalProperties (#6290)
* Mustache template should use invokerPackage tag to generate import

* Add a unit test for allOf and additionalProperties

* Fix getAdditionalProperties

* Add code comments

* Add code comments

* set nullable for additionalproperties

* add variants of additionalProperties

* Add more unit tests

* Handle additionalProperties for composed schemas

* improve code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add assertions in unit tests

* Add new property to support the 'additionalProperties' keyword with composed schemas

* run sample scripts

* fix unit tests to handle additionalProperties

* Handle additional properties and composed schema

* Handle additional properties and composed schema

* Add support for additionalProperties and composed schema

* Format java code

* Add more unit tests for Python

* Handle reference in additionalProperty keyword

* Handle reference in additionalProperty keyword

* Add use case for additionalProperties and reference

* run sample scripts

* resolve schema reference

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* add additionalproperties attribute with boolean values

* Run sample scripts

* handle additional properties

* Handle additionalProperties boolean values

* Run sample scripts

* fix javadoc issues

* fix javadoc issues

* Add Locale to String.toLowerCase

* execute sample scripts

* handle additional properties

* Add code comments

* Handle imports of referenced models in additional properties

* Handle isNullable class

* handle nullable type

* improve documentation, run sample scripts

* improve documentation, run sample scripts

* execute sample scripts

* execute sample scripts

* Execute sample scripts

* Run samples scripts

* set legacyAdditionalPropertiesBehavior to true by default, except python

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* Change name of CLI option

* Generate doc

* Add TODO statement

* add code comments

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* refactor cli option for additional properties

* refactor cli option for additional properties

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* Add yaml comments

* small refactor

* small refactor

* run sample scripts

* run sample scripts

* fix unit tests

* Set disallowAdditionalPropertiesIfNotPresent flag

* reduced size of test yaml file

* simplify code and add imports directly

* rename some of the properties used in tests

* Handle more scenarios for nullable types

* add code comments

* Adds *args input to __init__ method to fix test testFruitNullValue

* Resolve merge issues

* run samples scripts

* run doc generator

* fix merge conflicts

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2020-05-29 00:40:48 +08:00
William Cheng
07647b1a31
[Java] Decommission Retrofit 1.x support (#6447)
* decommission retrofit 1.x support

* remove retrofit 1.x from pom.xml
2020-05-28 21:43:38 +08:00
Januson
c49d8fda8e
[M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466)
* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
 - Update Java code generation to use sets instead of lists when uniqueItems is set to true
 - Add import resolution for sets
 - Add tests and fix broke tests

resolve #5254

* Update Javascript, Perl, Python and Ruby to preserve current functionality.

* Switch set implementation to LinkedHashSet

* Fix missing import for uniqueItems used on param.

* Fix missing import and return type for responses with uniqueItems

* Fix default values for array of enum

* Update generated samples

* fix merge issue

* Update generated samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-21 13:27:57 +08:00
William Cheng
a5b410993b
Set java8 to true by default (#6278)
* set java8 to true by default

* update samples

* update java-petstore-jersey2-java6.bat
2020-05-13 17:59:22 +08:00
William Cheng
deec5da8a7
[Java][jersey2] replace jersey2 with jersey2-experimental (#6251)
* replace jersey2 with jersey2-experimental

* better handling of oauth

* add jersey2 java8 samples

* add dependency to test pom

* fix test, update doc
2020-05-12 18:27:33 +08:00
William Cheng
f8a7475c7b update doc, samples 2020-05-03 16:18:33 +08:00
Justin Black
a2b613c1b3
Fixes md docs (#6079)
* Fixes md docs

* Separates out boolean enum options into legacyDiscriminatorBehaviorOpts

* Updates docs, adds true and false descriptions
2020-04-28 22:30:56 +08:00
Justin Black
8e8471c1fd
[CORE] Fixes composed schema discriminator map (#4906)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-25 00:01:02 +08:00
William Cheng
93dd4a5138
Add jersey2-experimental to Java client generator (#6024)
* add jersey2 experimental

* add new files

* add abstract one of class

* read the stream multiple times

* rename to getActualInstance

* update petstore

* fix jackon check

* test new java petstore in ci

* fix broken tests

* remove todo

* better exception message, primitive type handling

* add anyof support

* update samples

* add new files

* update all java client samples

* update doc, fix pom

* better null check for allOf

* add primitive types support in oneof, anyof

* better validation

* update python exp samples

* remove primitive type support in allOf
2020-04-24 12:47:25 +08:00
Sebastien Rosset
8af6b7459c
[Java] Discriminator lookup should not be case insensitive by default (#5894)
* Add 'discriminatorCaseSensitive' property

* Discriminator value lookup should not be case insensitive

* fix typo

* run scripts

* execute ./bin/utils/export_docs_generators.sh

* fix discriminator mapping, add code comments
2020-04-13 18:54:00 +08:00
Jochen Schalanda
e82546f342
Update generated build files for REST Assured (#5873)
* REST Assured 4.3.0
* Jackson 2.10.3
* Gson 2.8.6, GSON-Fire 1.8.4
* Okio 1.17.5
* Joda-Time 2.10.5
* ThreeTenBP 1.4.3
* Added missing dependencies for Bean Validation
* Added missing dependencies for `@Generated` annotation
* Refresh REST Assured sample project
2020-04-12 23:36:18 +08:00
Jim Schubert
e4823cf4e6
[go][java] Document new parameterized server support (#5380)
* [go][java] Document new parameterized server support

* [java] Regenerate samples
2020-02-22 20:06:38 -05:00
William Cheng
edd7cab22a
[Java] mark Feign 10.x (instead of 9.x) as the default (#5310)
* set feign 10x as default, mark 9x as deprecated

* update doc
2020-02-14 13:58:44 +08:00
Jim Schubert
aa7cd4f5af
[docs] Upgrade to Docusaurus 2 (#5271)
* [docs] Upgrade to Docusaurus 2

Due to formatting issues with Docusaurus 1 and code blocks, and upcoming
4.3 and 5.0 releases, this is an upgrade to have more control over
formatting and other functionality.

This adds behavior to have light/dark themes.

As a consequence of upgrading, columnar format on ul element in
generated generator docs had to be moved to css. This will not impact
users viewing the markdown on GitHub because it didn't display the
column format.

This upgrade should improve syntax highlighting and performance.

* Fix user page layout, choose theme with clear diff colors
2020-02-11 21:22:58 +08:00
Jim Schubert
a496c2011f
[docs] Initial FeatureSet generator documentation (#5188)
* Flatten feature sets for display

* [cli] Add feature set output to config-help

This includes markdown and plain text outputs for config-help.

* [docs] FeatureSet on generator docs
2020-02-01 20:51:55 -05:00
Jim Schubert
644f720db8
[docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
* [config-help] Sort all outputs

* Remove old/stale generator docs (these have been renamed previously)

* Sort config doc outputs, making it easier to find relevant info

* Fixes cliOptions duplicates

Erlang client/proper improperly set the version option as packageName
(causing duplicate for packageName).

The java and swift option removals are because the options are added in
parent classes, resulting in duplication of the options.

* Add --github-nested-index for generating docs/generators/README.md

* 📝 Regenerate generator docs
2020-01-19 20:19:11 -05:00
Jim Schubert
a2532cc3c5
[doc] full generator details (#4941) 2020-01-08 21:54:05 -05:00
Bruno Coelho
265ad2297b [kotlin] add options sortParamsByRequiredFlag and sortModelPropertiesByRequiredFlag (#4707)
* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin][client] sort parameters in the models

* [kotlin] update docs

* [kotlin][client] simplify sortParamsByRequiredFlag implementation

* [kotlin] experiment with sortnmodel properties by name

* [kotlin] introduce sortModelPropertiesByRequiredFlag

* [kotlin] update docs

* [kotlin] update kotlin

* [kotlin] fix tests

* [kotlin] update docs

* Revert "[kotlin] update docs"

This reverts commit 88ad825de5b4c090fe04398bdfde2e9d3252742f.

* [kotlin] update docs and petstores

* [kotlin] update docs

* [kotlin] update pet projects
2019-12-20 17:42:48 +08:00
William Cheng
ca9313881a update doc 2019-12-10 11:52:11 +08:00
Oleh Kurpiak
ba3af50384 [#4025] custom java annotations (#4026)
* custom java annotations
2019-12-03 08:09:39 -05:00
Jim Schubert
0e1ce6bb63
[docs] Custom template clarifications and other minor enhancements (#4167)
* [docs] Updating docsite outputs to be browsable on Github as well

* Fix links to other files
   Suffix `.md` was needed to make links works

* [docs] Add clarification to differences between customization and templating docs

* [docs] Collapsible side bar, scroll to top, minor enhancements
2019-10-16 18:04:44 -04:00
Jérémie Bresson
b0549fe6da
[java-client][rest-assured] add jackson support in addition to gson (#3795) 2019-08-29 17:34:37 +02:00
Jérémie Bresson
60e4c923dd [java][client] Add a "serializationLibrary" option (#3759)
* [java][client] Add a "serializationLibrary" option

* Update docs
2019-08-28 09:54:24 +08:00
Benjamin Douglas
43590582c5 Java 11 native HTTP client library (#3434)
* Initial commit of Java 11 native HTTP client port

* Rebase to master and add JSR305 for @Nullable

* Update samples with @Nullable annotations
2019-07-26 09:59:21 +08:00
William Cheng
203fc812bd
v4.0.3 release (#3315)
* update snapshot version

* update doc

* comment out haskell servant server test
2019-07-09 20:44:31 +08:00
Sai Giridhar P
dc3543981e feat(java-jersey2): Making response headers case-insensitive (#3072)
* feat(java-jersey2): Making headers case-insensitive

* feat(java-jersey2): Updating documentation
2019-06-04 22:03:01 +08:00
Sai Giridhar P
6b7c5edbce feat(java-okhttpgson): Making API response headers case insensitive (#3029)
* feat(java-okhttpgson): Making API response headers case insensitive

* feat(java-okhttpgson): Adding documentation

* feat(java-okhttpgson): Removing tabs

* feat(java-okhttpgson): Removing tabs
2019-06-03 15:40:22 +08:00
Vincent Devos
97e4270c0b [Java] improve docs with adding default value for additional properties (#2770)
* [Java] improve docs with adding default value for additional properties

* remove using File.separator for sourceFolder/projectTestFolder path

* Improve artifactId and artifactVersion description

* update doc java pkmst and sample
2019-05-06 22:31:12 +08:00
William Cheng
d3f418166b
mark java jersey1 client as deprecated (#2767) 2019-04-30 19:14:52 +08:00
William Cheng
5a6f4cb4a9
Update Java Vertx client dependency (#2507)
* update java vertx client dep

* update java client description

* update sample
2019-03-26 18:52:34 +08:00
Pablo Lázaro
ad8aa7dc0e [Java] adds snapshotVersion CLI option and uses API version as artifactVersion by default (#2033)
* [Java]: adds snapshotVersion CLI option and uses API version as artifactVersion by default

* fix some typos

* fix naming diff between branches

* ensure-up-to-date

* update samples
2019-02-18 17:54:27 +08:00
William Cheng
0a2fb8db8f
Remove localVarPrefix from Java client (#2045)
* remove localVarPrefix from java client

* rename local varaible

* update samples
2019-02-08 11:51:26 +08:00
Jim Schubert
6fe9a52229 [feat][docs][website] Initial docusaurus based site (#1770)
* Iniital docusaurus based site

* Remove error about default local being used by String.format

* Change pinned users to represent global presence rather than alphabetical order pinning

* Include generator indexes in ensure-up-to-date (docusaurus site and /generators/README)

* Add Font Awesome attribution footer

* Remove feature callout until it is completed

* Include NPM try it out section

* Improve "Getting Started" type docs

* Include new custom template documentation

* Updating templating and customization docs

* Add vendor extension docs

* Cleanup templating page(s).

* Move users to yaml file for easy edit.

* travis configuration, and baseUrl mods to image URLs

* [docs] Migrate FAQ, release summary  from wiki

FAQ has been split into multiple smaller documents to better categorize
and allow users to find what they're looking for (in docs folder or in
new website).

Release summary information (versioning strategy and cadence) has been
migrated from the Wiki and clarified a bit.

Also adds copy button for all code snippets in website.

* Copy current contributing/code of conduct to website

* [docs] Creating a new generator
2019-01-18 17:39:33 +08:00
William Cheng
2c051f265c
Add an option to use reflection in equals, hashCode (Java client) (#1767)
* add option to use reflection in equals, hashcode (java)

* add model test template to java client only

* update pestore samples

* update java samples

* update doc

* update usage, remove unused file
2018-12-31 10:03:05 +08:00
mwoodland
8c0e130481 Allow specifying/overriding the parent in the pom file for Java and S… (#1132)
* Allow specifying/overriding the parent in the pom file for Java and Spring generators.

* Don't add extra whitespace to the pom file when the parent isn't overridden.

* Remove accidentally added white space.
2018-10-09 08:34:29 +08:00
William Cheng
1b2f3fbfb6
Fix alias to map response (#1067)
* fix response reference to map

* update samples

* add null check for openapi
2018-09-20 19:29:33 +08:00
Ilya Hrankoŭski
aa29219f8c [Java][Feign] Add support for Feign 10 (#977) (#988) 2018-09-09 18:11:59 +08:00
Jérémie Bresson
31149a5a69
Publish documentation for the generators (#932) 2018-08-31 16:00:27 +02:00