* Add config option to enable InversifyJS
* Add pascal case lambda for mustache
* Generate a class for each auth method
* Add service identifiers and service binder helper
* Split Configuration into interface and factory
This way we don't need to import the factory everywhere to do
typechecking.
* Define minimal interface for ServerConfiguration
* Add annotations for inversify when enabled
* Always expose list of server configurations
* Add samples and defalt tests for useInversify
* Simplify sample generation script
* Fix: Add object_params arg description to help
* Fix: Properly enable inversify with bool property
* Build tests in pom instead of prepublish
Otherwise running `npm install`, when the build failed was impossible.
* Update dependencies for inversify tests
* Test basic api service resolution
* Remove Promise and Observable prefix from exports
* Fix, RxJS: Import Observable in object params api
* Add ioc service identifier for object param api
* Add hint about unimpeded development
* Simplify api service binder syntax
* Remove default tests for inversify
* Add wrapper for easy promise based http libraries
This wrapper allows defining and injecting http libraries that do not
need to know anything about observables, especially when useRxJS is not
enabled. I will employ this in the tests for InversifyJS.
Not sure if we should also use this wrapper internally.
* Add named injects for remaining auth parameters
* Directly inject promise services without RxJS
* Add tests for api service binder
* Add convenience method to bind all api services
* Fix: Rename inversify test artifact
* Run bin/utils/copy-to-website.sh
The current `npx ` command says to use:
```
npx openapi-generator generate -i petstore.yaml -g ruby -o /tmp/test/
```
This however, pulls a similarly-named but different project: [zhang740/openapi-generator](https://www.npmjs.com/package/openapi-generator).
This commit fixes this, by using the appropriate package `@openapitools/openapi-generator-cli`
* [breaking] Enforce vendor extension naming convention
* [breaking] Rename system properties to global properties
* [docs] Update site with global properties list and usage explanation
* Use proper vendor extension casing in all templates
* Set remaining vendor extensions to convention of lower kebab-cased with x- prefix
* [samples] Regenerate
* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
Before we were adding hasPathParams twice, once with !op.pathParams.isEmpty(), and then again with hasPathParams. This was probably caused by a mistaken merge.
This is causing the difference in samples
Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>
* [Samples] Regenerated!
* Fix -D conversion to additional-properties, missed in bat files
* JERSEY2 option changed
* [samples] Regenerate
* [scala][finch] Fix remaining vendor extensions format to conventino
* [scala] The -D option was replaced with --global-property
* [samples] Regenerate
* Fix -DskipFormModel usage which has been moved to --global-property skipFormModel=true
* [samples] Regenerate
Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>
* 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>
* [cli] new 'author template' command
This new command allows users to extract templates for authoring
(customization) without the complexity of finding and downloading a
specific directory for their versioned artifact.
Example usage:
```
openapi-generator author template -g java --library webclient
```
This will write all templates with library-specific templates to the
'./out' directory relative to the current directory.
CLI will refer the user to
https://openapi-generator.tech/docs/templating after generation
* [docs] Usage of author template command
* Log warning if author template fails to output requested library
Fixes a handful of issues identified in https://github.com/OpenAPITools/openapi-generator/issues/802#issuecomment-617262139
List of changes
* Clean: Remove redundant cliOption definition
* Remove redundant directory structure in templates
If we need to have different index.ts files for the different
frameworks, we can mostly do that in the one mustache file. In the cases
where that is not possible, we can still add a new override file later.
* Use File.separator consistently
* Only export selected api type
* Simplify promise polyfill import
The behaviour should be the same, according to the es6-promise docs.
Previously tsc would report the error:
> error TS2307: Cannot find module 'es6-promise'.
* Import HttpFile in all models
* Export server configurations
* Use undefined as default body value
The empty string is not interpreted as "no body" by the browser fetch
api and thus leads to an exception during get requests
* Improve codestyle: prefer guards to nesting
* Remove verbose debug output
This should not be commited, because every developer has very different
requirements what debug information he needs to see.
* Fix: Use cleaned model names for imports
* Fix: do not call toString on undefined
* Fix typo in doc comment
* Introduce RequestBody type and remove method check
* [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>
* Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator
* Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin
* Fixed generating retrofit2 without Rx/Coroutines
* Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation
* Fix documentation diff.
* Fix generating build.gradle file for samples.
Add dependencies for rxJava/rxJava2 and rx retrofit's adapter.
* Update generated sample with rx dependencies
* Update generated sample with coroutines
* Update generated sample with RxJava 2 dependencies
* Update and refactoring scripts for sample generation
* Update generated sample code
* revert changes by mistake
* revert changes by mistake #2
* Fix return type for first RxJava
* Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2
* Fix script loggin
* Update generated code for RxJava 1/2
* Fix kotlin.md documentation by script export_docs_generators.sh
* Update Kotlin samples project in pom.xml
* Revert "Update Kotlin samples project in pom.xml"
This reverts commit 9de4d0ba
* Fixed "" wrapping number types for annotation value
Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model.
Fixed instantiationTypes(array, list, map) for Kotlin generator
* Update Kotlin samples project after last fixes
* Update Kotlin samples project for kotlin-jvm-*
* Update Kotlin readme.md documentations
* Update Kotlin client sample changes
* Fixed encoding braces for generics model
* Update Kotlin client sample changes
* Update Kotlin client sample after merge with master
* Fixed adding empty braces for inherit from Map/Array
* Update sample model after last fix with empty braces
* Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson
* Update Kotlin client samples with adding @get:SerializedName
* Changes in mustache file to include new option
- New options `useSingleRequestParameter` to use a single param for the request, instead of one param per request param.
* Chanes in the documentation
Include new parameter `useSingleRequestParameter`.
Default value = `false` to keep compatibility with previous versions.
* Include script to generate samples
Also included script in the script that runs all
* Generate new samples
- Previous samples have a minor change (one line is deleted)
- New sample generated with the new parameter set to true
* Include scripts for windows
* Include new CLI option in codegenerator class
* Change the order for the new parameter in the docs
* add scaffolded new documentation generator files
* add openapi3 plantuml bin scripts
* change plantuml codegen to only generate a schemas.plantuml file
* initial plantuml schema diagram
* add item type to Lists
* add inheritance relationships
* add list one-to-many relationships
* add newline between model definitions and relationships
* add composition data type relationship
* remove allOf models and interface references
* add new entities data to SupportingFileData
* add List dataType support to entity fields
* remove composed types and remove allOf suffix from inline types
* add inheritances to supporting files data object
* add aggregation relationships to supporting file data
* add isList to compisition relationships
* refactor PlantumlDocumentationCodegenTest
* add property name to relationships
* remove old code form PlantumlDocumentationCodegen
* add plantuml generator sample output
* remove use of javafx.util.Pair
* fix casing of complex data type for fields
* add plantuml generator docs
* fix bug caused by assumption that inline _allOf types will always be unique but apparently they can be shared if they have identical properties!
* fix bug with missing relationships caused by shared identical _allOf schemas
Co-authored-by: Patrick.Burls <patrick.burls@bskyb.com>