* add option to generate alias as model
* [JAXRS/CXF] Emit method bodies, test data (#1158)
New jaxrs-cxf-extended generator with options:
- supportMultipleSpringServices Support generation of Spring services
from multiple specifications
- generateOperationBody (boolean) Enables generation of fully
functional test/service method bodies that pass/return random
but valid values & models.
- loadTestDataFromFile (boolean) When true, generated method bodies
load test data from a generated JSON file. When false, generated
method bodies contain inline code to construct the test data.
- testDataFile (string) The path of a JSON file to contain generated
test data. The file is initially generated but editable; edits are
preserved by subsequent generations.
- testDataControlFile (string) The path of a JSON file to control test
data generation - specifically, to control the number of items
required in array properties, structured by API class
/ operation name / parameter name. The file is initially generated
but editable; edits are preserved by subsequent generations.
- tests for the jaxrs-cxf-extended generator, including the new options
Bug fixes:
- fix bug (DefaultGenerator): handle absolute paths in supporting file
spec
- fix bug (DefaultCodegen): process enums in allVars
- fix bug (AbstractJavaCodegen): support multiple inheritance via
allOf (inheritance code deleted, as a subsequent pull broke it)
- fix bug (JavaCXFServerCodegen): use operationId instead of nickname
(gets out of step with duplicate operationIds)
- fix bug (JavaCXFServerCodegen): set appropriate default
consumes/produces for operations with body parameters or non-void
returns (CXF providers don't handle */*)
- fix indentation (DefaultCodegen)
- add support for a system property openapitools.implementation.version
to specify the package implementation version when running non-JAR'd
classes in an IDE (otherwise {{{generatorVersion}}} evaluates to
'unset'.
* reformat code
* make sh executable
* fix template folder
* fix template folder, update samples
* run test data manually to avoid ci failure
* Fix typo in (unused) method name
* Tidy up Rust server generator
Remove some repetition and use some nifty new methods introduced in Java 8
* Start using Objects.hash and Objects.equals
* Convert more equals implementations over
To use Objects.equals
* Convert more hashCode implementations over
To use Objects.hash. Might have the pleasant side-effect of improving
performance a bit.
* Typescript 3.2
* Typescript spread operator
* Add vendor extension to the operation
* Remove url.URLSearchParams
* Generate form data in API
* Make axios scripts executable
* Reran generator
* Generate sample code
* Codegen having the model and api extra flag
* Revert to 2.4 Typescript
* COLLECTION_FORMAT.{{collectionFormat}} everywhere for consistency
* Consistency on the CollectionFormats, comment on the vendor extension
* Throw exception if api and model packages are not given
* Templates splitting api and models
* Post process the operations in the the process
* Beginning to get the axios tests up
* Ensure-up-to-date doesnt include TS/Axios tests
* Docs update for Typescript/Axios
* Merge master
* Api tests re-run
* Add windows bat file
* fix resources management
* remove obselete if statement
* throw exception when body is null
* prevent potentional nullpointerexception
* use valueOf instead of constructor
* remove duplicated code
* avoid unclosed resources
* remove redundant key
* fix broken tests
* fix sonar issues
* fix tests
* add Veamly as a company using openAPI generator
* revert back if statement to explicitly express the intention behind it
* chore: apply release mode for the Dockerfile
* docs: update by `./bin/go-gin-petstore-server.sh`
* docs: update by `./bin/openapi3/go-gin-petstore-server.sh`
* update ZenTest
ZenTest 4.11.1 requires rubygems 2.x.
But Ruby 2.6.0 include rubygems 3.x.
So we can't use ruby client in Ruby 2.6.0.
https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/
ZenTest 4.11.2 removed rubygems dependency so we should update.
1883b210aa
* update ruby client sample
* Add ability control out put generation and support to generate a library
* Roll back pom version - it seems to break the CI/CD checks
* Roll back pom version - it seems to break the CI/CD checks
* Match with genrators - no changes from new code
* Fix inadvertent changes
* No idea why the names of params have changed pet to body for instance
* Match generated document
* Clarify logic as per PR review
* Remove the generatewwwroot option and use the buildtarget option
* Remove ar artifactVerson (not used), update docs and TODO notes
* Add ability control out put generation and support to generate a library
* Roll back pom version - it seems to break the CI/CD checks
* Roll back pom version - it seems to break the CI/CD checks
* Fix inadvertent changes
* Match generated document
* Add ability control out put generation and support to generate a library
* Roll back pom version - it seems to break the CI/CD checks
* Roll back pom version - it seems to break the CI/CD checks
* Fix inadvertent changes
* Match generated document
* Clarify logic as per PR review
* Remove the generatewwwroot option and use the buildtarget option
* Remove ar artifactVerson (not used), update docs and TODO notes
This allows easier creation of custom `GenerateTask`. Specifically, this makes:
- generateModelTests
- generateModelDocumentation
- generateApiTests
- generateApiDocumentation
- withXml
optional, following the same pattern as other properties in GenerateTask.
Without this change, we get `java.lang.IllegalStateException: No value
has been specified for this provider.` until these properties are
specified for the task, when attempting to define a custom generate task
(such as one to generate API docs).
* Add test case which reproduces the issue
* Fix missing `nullable`
* Tweak property name
* Add test case which covers `Paths`
* Add test case for CodegenProperty.isNullable
* Fix missing CodegenProperty.isNullable
* Rename r -> referencedSchema
* 2125: java-resttemplate: Support collection formats in pathParams
* run ./bin/java-petstore-resttemplate.sh
run ./bin/java-petstore-resttemplate-withxml.sh
* changed the package install instructions to install the .tgz package instead of symlinking the package - otherwise you'll get trouble with links on windows
* samples added
* added samples
* [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
* [typescript-angular] Update default Angular version from 4.3 to 6.0 (NPM Client)
* [typescript-angular] Update default Angular version from 4.3 to 7.0 (NPM Client)
Based on this [issue](https://github.com/servo/rust-url/issues/416) the `utf8_percent_encode` doesn't percent encode `+` instead treats it as a space which is may cause a problem if the query parameters contain one. For example if we wanted to use a DateTime range in query parameters:
`{base_path}{path}?start=2019-02-12T00:00:00+00:00&end=2019-02-13T15:00:00+00:00`
These parameters may be decoded as:
```
start = 2019-02-12T00:00:00 00:00
end = 2019-02-13T15:00:00 00:00
```
To solve this I changed query parameters to be form-urlencoded using `url::form_urlencoded` based on what's done in [`rust` client generator](ea08106c80/modules/openapi-generator/src/main/resources/rust/request.rs (L106)).
* Issue 1766 Modified mustache files for Go to support nullable in the spec v3.0+; Updated model files running .sh scripts for Go.
* Add "nullable" to fake yaml
* Add sample script for OAS3
* Fix output folder (openapi3)
* Run bin/openapi3/go-petstore.sh
* Update samples
* Update jaxrs-jersey
* Update python and php samples
* Add bin/openapi3/go-gin-petstore-server.sh
* Run bin/openapi3/go-gin-petstore-server.sh
* Update bin/openapi3/go-petstore-server.sh to generate "nullable" samples
* Run bin/openapi3/go-petstore-server.sh
* Fix duplicated `import`
* Typescript 3.2
* Typescript spread operator
* Add vendor extension to the operation
* Remove url.URLSearchParams
* Generate form data in API
* Make axios scripts executable
* Reran generator
* Generate sample code
* Revert to 2.4 Typescript
* COLLECTION_FORMAT.{{collectionFormat}} everywhere for consistency
* Consistency on the CollectionFormats, comment on the vendor extension
* fix compilation error
Rust clients code format cleanup (with some breaking changes for model structures):
* Application of Rust style in client files (4 spaces padding). Remove useless blank lines.
* Replace getters/setters in models by public fields.
* Add a trailing comma in struct fields.
* Sample Rust clients regeneration.
Previously, if you used a packageName of the form "foo.bar.baz", half of the
generated files of the python generator went into a subdirectory
"foo/bar/baz" (correct), the other half went into a subdirectory
"foo.bar.baz" (incorrect).
* use double-quote string for enum value (#2081)
* use enumVars in templates for Ruby client (#2081)
* delete unnecessary line in enum model of Ruby client (#2081)
* update samples of Ruby client (#2081)
* fix#457 by introducing an HttpBearerAuth object
See https://github.com/OpenAPITools/openapi-generator/issues/457
Also https://github.com/OpenAPITools/openapi-generator/issues/1446 for typescript, https://github.com/OpenAPITools/openapi-generator/issues/1577 for python
Specs defined as follows currently generate BasicAuth and send an "Authorization: Basic [base64Encode(username + ":" + password)]" header
components:
securitySchemes:
bearer:
type: http
scheme: bearer
This change will generate code which uses a new HttpBearerAuth class, which will send a "Authorization: [scheme] [accessToken]" header.
This change is slightly larger and more impactful than simply using OAuth for bearerBearer, but it allows for scheme values other than bearer.
This fix was enabled by the recent commit of 80ca67cfda
This PR is an alternative to https://github.com/OpenAPITools/openapi-generator/pull/1972
* update petstore samples
* Update HttpBearerAuth mustache templates and samples
* correct the expected number of generated java client files
* update the retrofit2 HttpBearerAuth template and samples
* Add resttemplate-specific HttpBearerAuth mustache and samples
* add vertx-specific HttpBearerAuth template and samples
* add java webclient-specific HttpBearerAuth template and samples
Previously, if you used a packageName of the form "foo.bar.baz", half of the
generated files of the python generator went into a subdirectory
"foo/bar/baz" (correct), the other half went into a subdirectory
"foo.bar.baz" (incorrect).
* Resolves#525 for Rust client generator with reqwest library.
* Use Reqwest "query" method to generate query URL.
* urlencode URL string parameters.
* Generate rust-reqwest client, and verify it compiles and work as intended.
* Map file params (to "&std::path::Path") and support multipart operations (with file params) in Reqwest library.
* Cleanup: template compression to remove unecessary blank lines in generated code.
* - support for PHP 7.1, Zend Expressive 3.2 and PathHander 0.4 for php-ze-ph generator
* - fixed mess with petstore samples (added new files, removed obsolete files)
* php-ze-ph:
- overwriting "*/*" media type for producers with "n/a" (PathHandler does not support that cause it makes no sense to return response with "Content-Type: */*")
- "array" return type declaration for handler methods with ambiguous "container" return type
- better way to generate attribute annotation stub for request body data with ambiguous "container" type
- fixed missing dependency in composer.json
- minor optimization for container.php
- samples for OAS3 petstore spec
* php-ze-ph:
- note about ext-yaml in stub README
- updated .gitignore
* php-ze-ph:
- logging '*/*' replacement as warning
* add multiple servers support to JS ES6
* multiple server support in js es5
* using exports in es5
* fix index check
* add oas v3 js es6 client to travis
* add multiple server support to python client
* various fixes
* minor fixes, add tests
* test oas2 python first
* fix tests
* fix issues reported by flake8
* update code format
* add python petstore to ensure up-to-date
* rearrange test
* fix E501
* fix tests
* add new files
* fix script permission
* fix index check
* update samples
* Allow connection on port != 80 or 443
In the current implementation a client can't connect on another port than 80 or 443
This commit allows to specify a host like "localhost:8080" when creating the client
The port is then used when initiating http requests
* Update Petstore Sample for CI
* Fix unused return value
* Update petstore sample
* Rename host parameter into authority
* 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
* update okhttp to latest version
* update templates to use okhttp3
* update java samples
* fix tests
* update tests under CI/samples.ci
* add tests to java client
* fix bin script to restore test files
* fix debugging
* add more tests and minor fixes
* update samples
* Clean up file output handling
This attempts to normalize all generators to use OS agnostic
File.separator.
It also cleans up some areas in code where we replace "." in full file
output path with File.separator. We should only be modifying directory
names we own, and should avoid modifying anything that can be provided
by a user.
It would probably be better to use Paths.get(…).toString() in all cases.
* Fix missed path separators in java codegen
* Adjust Java codegen path replacements
* Convert / in full path replacements, as / is forbidden in Windows, and noop elsewhere
* Use Paths.get where files are written, to better handle Windows path constraints
* Add test case that reproduce the issue #1782
* Fix missing RequestBody.required
* Update samples
./bin/utils/ensure-up-to-date
* Run ensure-up-to-date script
./bin/utils/ensure-up-to-date
* Add test case that reproduce issues
* Fix a problem that points to a folder that doesn't exist
* Improves for windows
* Run ensure-up-to-date script
./bin/utils/ensure-up-to-date
APIs may more than one auth method (for example both an app key and basic auth).
This changes the example to only initialize the config option once instead of once per auth method.
* [gradle] Add 4 boolean properties supported by codegenConfigurator
* [gradle] Add Windows workaround for Android Studio
After release 3.0.0, a guava dependency was updated and this exposed an
issue in Windows where Guava's CharMatcher.ASCII is called to validate a
path. The version of Guava referenced by OpenAPI Generator causes a
'NoSuchField' error because the referenced dependency names this static
field CharMatcher.Ascii.
This error is not surfaced on macOS, and appears to be Windows-specific.
This adds a potential workaround to the Gradle plugin's readme.
See #1818 for more details.
* Adds two models to the v2.0 spec, uses examples as defaults in python client
* Adds array default and type_holder_default and type_holder_example tests
* Re-generated python security client with ./bin/security/python-petstore.sh
* Changes comment text, rebased master
* Updates client + server samples
* Adds missing samples updates
* Changes python client to look for true or false with booleans in toDefaultValue
* Changes boolean casting to use Boolean.valueOf
* Adds deserialization fix for python tests
* Changes Mock to namedtuple in python deserialization tests
* Actually remove unittest.mock
* fix: force to decode as utf-8 when header contains application/json to avoid text garbling.
The original processing is using `response.body` to deserialize as json.
However, this is decoded by latin1 if the header contains only "application/json" instead of "application/json; charset=utf-8".
Because of this behavior, if the response body is encoded UTF-8 but the headers doesn't contain charset, the body will garbling.
cf: https://github.com/dart-lang/http/issues/175
Since playframework 2.6 returns "Content-Type: application/json" without "charset=utf-8", I changed this parsing algolithm.
* fix: force to decode as utf-8 when header contains application/json to avoid text garbling on error.
* fix: set fields to null if json value is null.
* rebuild dart2 petstore
* rebuild dart petstore
* rebuild petstore
* [DART]fix: set fields to null if json value is null.