* fix(typescript-axios): add Set as language primitive
* fix(typemapping): added lowercased set as primitive type
* fix(samples): regenerated ts samples and added Set as language primitive to ts docs
* Fix dir path in PR request template
* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)
* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)
* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)
* #6715 - Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed.
* feat(typescript-rxjs): add support for returning statusCode and progressSubscriber via function overloading
* feat(typescript-rxjs): use ?? instead of || to support relative basePath of "", upgrade to typescript 3.7
* feat(typescript-rxjs): regenerate samples
* refactor(typescript-rxjs): change explicit undefined checks to shorthand return
* feat(typescript-rxjs): add missing progressSubscriber key when building RequestArgs
* feat(typescript-rxjs): regenerate samples
* style(typescript-rxjs): remove whitespace, add colons
* feat(typescript-rxjs): regenerate samples
* refactor(typescript-rxjs): destructure configuration in BaseApi
* fix(typescript-rxjs): returning empty string for apiKey and accessToken
* feat(typescript-rxjs): replace withStatusCode option with response = raw option, reuse rxjs AjaxRequest and AjaxResponse types
* feat(typescript-rxjs): regenerate samples
* Prints out the parameter name in throwIfNullOrUndefined
* Fixed misspelling
* feat(typescript-rxjs): add withProgressSubscriber additional-properties flag to cli, remove unused withInterfaces flag
* refactor(typescript-rxjs): use backticks instead of String constructor in encodeURI
* feat(typescript-rxjs): replace Object.keys() with Object.entries() in queryString helper
* style(typescript-rxjs): improve indentation of new withProgressSubscriber checks within templates
* feat(typescript-rxjs): use entire es2017 lib in tsconfig.json for building with target es6
* feat(typescript-rxjs): regenerate samples
* feat(typescript-rxjs): adjust sample generation, regenerate samples
* docs(typescript-rxjs): regenerate docs
Co-authored-by: Justin Van Dort <justinvandort@gmail.com>
* add 'deno' to typescript platforms
* add Deno support to typescript generator
* add Deno support to typescript generator
* add Deno support to typescript generator
* add Deno support to typescript generator
* add Deno support to typescript generator
* add extensionForDeno property for typescript generator
* add URLParse Deno wrapper for typescript generator
* update deno version in .travis.yml
* Dynamic server support
* regenerated
* Apply suggestions from code review
Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>
* regenerated
* Add ParameterizedServer feature to Python experimental
* Fix lookup of server variables
* Add tests and change default value for servers
* Fix server variables
* Return base path when index is None
* Use HOST
* Apply suggestions from code review
* Apply suggestions from code review
* regenerated
* Add specific tests for dynamic servers
* regenerated
* add docstring
* regenerated
* Fix wrong merge resolution
Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>
* Added http module draft
* Added generic enum
* Modified http lib, added config & middleware definition to ts-fetch
* Added model generation with imports
* Added auth module
* Added servers
* Added sample for typescript client
* WIP: Models & API
* Updated auth
* WIP: api modeling
* Implemented RequestFactory and Processor completely
* Implemented fetch client
* Ignore dist folder in typescript client sample
* Added middleware to fetch
* Restructured TypeScript generator
* Reverted: http library.send returns string again
* Removed TODOs
* Added pom.xml files to TypeScript PetStore client samples
* Removed tabs from TypeScriptClientCodegen
* Added ts client codegen to root pom.xml and travis
* Added server variable configuration to ts-refactor
* [TS-Refactor] Added tests for Object Serializer
* Added simple test for PetApi
* Fixed ObjectSerializer test
* Added handling for different http status codes and test for deletePet
* Removed tabs in TypeScriptClientCodegen
* Removed tabs in DefaultCodegen
* Additional tests for pet store api
* Fixed file uploads
* Made api call configuration separately settable
* Use string union for enums
* Remove tab
* Restructured module layout
* Use observables internally
* Added promise based middleware
* Made discriminator and attributeTypeMap readonly
* Configure discriminator correctly
* Set discriminator value automatically
* Fixed date-time and date handling
* Added comments & license info
* Added comments
* Ignore openapi-generator-cli/bin
* Removed accidentally created generated code
* Fixed compilation issues in TypeScriptClientCodegen
* Added typescript to docs/generators
* Updated docs
* Added gitignore and git_push
* Added jquery library
* Added pom.xmls, fixed packagejsons and hopefully webppack
* Removed tabs in TypeScriptClientCodegen
* Fixed a couple issues with pom.xml
* Ensured up to date
* Fixed missing fetch definition in TS default tests
* Updated typescript docs
* Refactor typescript merge master (#4319)
Merge master into ts-refactor
* Typescript refactor: stub rxjs (#4424)
* Remove unused supportsES6 field from codegen
* Add a new switch for RXJS
* Remove redundant npm dependency on rxjs4 types
* Fix return type of PromiseMiddleware methods
* Install webpack dependency to run jquery tests
* Update form-data to 2.5 which includes typings
* Add missing dependency on node typings
* Fix test artifact name typo
* Stub rxjs when it is not explicitly enabled
* Typescript refactor: Platform select for browser and node (#4500)
* Use string form of filename parameter
This works for the form-data library and is also compatible with the
browser FormData object.
* Add new option to select platform node or browser
When no platform is selected, a default is chosen by the framework
option and likewise the file data type option is implied by the
platform.
* Remove redundant import of node dns module
* Only use form-data library for node platform
* Generate npm package from npmName option
* Use method convertPropertyToBooleanAndWriteBack
* Generate typescript samples with ensure-up-to-date
* Removed tab from DefaultCodegen
* Readded missing change
* Mark typescript client codegen as experimental
* Removed whitespace
* [TS-Refactor] Top-level exports for fetch & jquery (#6138)
* Added top-level exports
* Updated generator README
* Updated typescript generator docs
* Allow browsers File type for files (#5521)
* Allow passing file parameters as File objects
* Add test for jquery upload
* Use HttpFile object for node platform
* Regenerate samples
This is by far the most common use case. A `File` object already
contains the name attribute. This commit allows that information to be
used directly.
When sending a `Blob`, in most browsers the `File` constructor can be
used to assign a file name. In all other browsers the alternative is
```typescript
Object.assign(data, { name: "foobar.txt" });
```
That is why we explicitely pass the name as third parameter to
`FormData.append`. This `Object.assign` method also works for `Buffer`
objects in node.
If one really does not want to touch the data object in the browser it
is possible to define another reference to the data with
```typescript
new Blob([data], { type: data.type })
```
or in node via
```typescript
Buffer.from(data)
```
* [TS-Refactor] Added options for npm version, repository, name and updated readme (#6139)
* Added options for npm version, repository, name and updated readme
* Removed `this` where not required
* Updated typescript docs
* Typescript refactor fixes (#6027)
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
* Support media types other than json (#6177)
List of changes:
* Add */* as fallback to accept header
* Use more sophisticated media type selection
* Handle object stringify in ObjectSerializer
* Parse response with ObejctSerializer
* Fix: Correctly extract response headers in browser
* Create HttpFile objects from responses
* Handle binary responses
* Clean up dependencies and replace isomorphic-fetch
Instead of isomorphic-fetch, which is unmaintained, we directly use
node-fetch and whatwg-fetch polyfills.
* Updated versions in ts-default/jquery and ts docs
* Replaced isSuccessCode with is2xx
* [TypeScript-Refactor] Use OAIv3 spec and fix bugs in JQuery Blob download (#6416)
* Change to OAIv3 spec for TS-Refactor
* Moved samples to oaiv3 folder
* Updated package-lock
* Update pom to use OAIv3 paths for Typescript-refactor
* Renamed ts-refactor samples & tests in pom.xmls
* Fixed compile issues in ts-refactor jquery http test
* Fixed bugs in blob handling of jquery
* [Typescript] Support http bearer authentication with token provider (#6425)
* Add http bearer security
* Update typescript to 3.9
* Fix: Use Authorization header for basic and bearer
* Allow asynchronous tokenProvider in bearer auth
* Add TS-Rewrite-Jquery tests node_modules to travis caching
* Remove NoAuthentication
* Added file to generate TS samples on Windows
* Exclude btoa in browser
* Regen samples
* Remove outdated ToDo comments
* Document and optimize `getReturnType` in TSClientCodegen
* Added option to generate objects for operation function arguments
* Upgrade typescript docs
* Updated generators
* Updated samples
* Updated docs
* Readded pom.xml
* [Typescript] Support InversifyJS (#6489)
* 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
* Restore changes to CONTRIBUTING.md from PR #6489
Co-authored-by: Bodo Graumann <mail@bodograumann.de>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
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
* [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>