* Add test case to reproduce the issue
https://github.com/OpenAPITools/openapi-generator/issues/2574
* Fix: an alias of "an alias of simple OAS type" has an incorrect property `isAlias: false`
* Use ModelUtils instead of referring the "type" value directly
* Delete an unnecessary condition
* Tweak: the order of conditions
* Fix wrong "isAlias" value on ComposedSchema
* Added toString to enum_class script
This toString avoids using the enum var name and uses the enum's value instead. This will fix cases when enum var name and value are quite different.
* Updated enum template
Co-Authored-By: Jim Schubert <james.schubert@gmail.com>
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
* 👕🎨 Minor refactor DefaultGenerator
This cleans up some lint warnings and improve general code cleanliness
of DefaultGenerator.
Specifically:
* logger strings are now using the built-in log formatter rather than
constructing new strings regardless of log level.
* Diamond operators are used where possible
* Some long-unused commented code has been removed
* Lambdas are used where possible
* Redundant operations are merged (HashMap constructor used rather than
subsequent putAll on a collection, for example)
* [cli][core] Add support for dry-run and display
CLI now supports `--dry-run`, which will output a file change status
similar to git status --porcelain.
The user may also specify `--verbose` for a one-liner below each file
explaining why the change operation might take place.
* [typescript-rxjs] fix coalescing in Configuration
- eliminate nully "" (empty string) value via conditional check
- use concrete "string" type in typeof check
("function" may be returned for Object types
* [typescript-rxjs] update petstore sample
* run petstore-all
- run the script for updating all petstores
./bin/typescript-rxjs-petstore-all.sh
* python: Add gitlab-ci.mustache
It does the same stuff as in the .travis.yml but just for Gitlab CI
#5340 - Python .gitlab-ci.yml
* python: Run all scripts in bin
find bin/ -type f -name 'python*.sh' -exec {} \;
Had to update all samples
* Remove DateTime mapping from concrete TypeScript generators that do not have full support for Date deserialization
* Fix model unit tests
* Regenerate samples
* [kotlin][client] remove null message on server error
* [kotlin][client] avoid breaking change
* [kotlin][client] add response to client and server exceptions
* [kotlin][client] improve message on ClientException and ServerException
* [templates] Update to vendor extension standard keys
* Fix missed value in Java template, also implements=>x-implements. Evaluate Haskell Client changes
* Fix missing accept/content-type update for vendor extension format
* type aliasing issue
* Add example OpenAPI document from issue 3589
https://github.com/OpenAPITools/openapi-generator/issues/3589
* Add test to reproduce the issue
- type of TypeAlias changed from 'string' to 'object'
(not sure if importMapping is supposed also for 'string' types...)
- there might be better ways to write the test, it's kind of a brute
force test (generate a file and parse it with a regexp)
* Remove duplicate test file
* Add new method override handleMethodResponse
Fixes broken unit test after merge from master
Co-authored-by: bkoziak <bkoziak@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
* 3432 Use builder api of OkHttpClient to avoid UnsupportedOperationEx
The reason for the UnsupportedOperationException was an invalid access to the interceptors list of OkHttpClient. That list is unmodifiable as stated by the JavaDoc. Instead accessing the list directly, the interceptors should always be passed when building the client by the builder api.
* 3432 Use builder api of OkHttpClient to avoid UnsupportedOperationEx
The reason for the UnsupportedOperationException was an invalid access to the interceptors list of OkHttpClient. That list is unmodifiable as stated by the JavaDoc. Instead accessing the list directly, the interceptors should always be passed when building the client by the builder api.
* 3432 Follow-up fix to make samples compile again
* 3432 Updated sample implementation for okHttp-Gson-ParcelableModel
* initial commit for null type
* Add openAPI attribute to validation and recommendation
* improve code comments. the warning used to notify the users to use instead of defining the schema inline, but now the InlineModelResolver has been enhanced
* Add validation rule for the supported values of the 'type' attribute
* [typescript] Don't hardcode the date type if user has mapped it
If the user has set --type-mappings Date=foo, respect this setting
instead of hardcoding the date type.
* Use default type mappings for date/date-time
* Use typeMapping mechanism correctly
* Add default mapping for angular and node to preserve behavior
* One more change to keep current behavior
* Add default type mappings to the other TS generators
* [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
* [go-experimental] Add oneOf support
* Fix docs for the oneOf models
* isOneOfInterface => x-is-one-of-interface
* Add proper warnings when inline models are used in oneOf choices
* Add a convenience method to oneOf implementing structs to cast them as the oneOf interface
* Update modules/openapi-generator/src/main/resources/go-experimental/model.mustache
Co-Authored-By: Jiri Kuncar <jiri.kuncar@gmail.com>
* Fix retrieving data from additionalDataMap
* Add basic tests
Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
* [typescript-fetch] Make additional properties access safer
Instead of asserting that any key access returns a valid property, force
the consumer to check that the value is defined.
* Update tests
* Put null-safe additional props behind and flag and share
* Undo over copy
* Update docs
* Rearrange code
* Move to unit tests
The maven documentation was missing a few option, a couple of option
properties, and was inconsistent regarding selective generation for apis
an models. This adds properties and options where appropriate and
updates the docs. All options in the README have been reordered to match
property declaration order in CodegenMojo, hopefully making it easier
for maintainers to recognized when there are docs missing or out of
date.
This also slightly refactors the code in CodegenMojo to reduce the
cyclomatic complexity of the `execute` method.
This fixes issue #3796 for JavaSpring. It's a very straightfoward extension
of #5120 for the JavaSpring generator (that PR was just for the Java generator).
* Reduce redundancy in python docs
This is a followup to PR #5094, which had a few unresolved comments at
merge time. This reduces the amount of redundant lines in the api
example doc templates, and ensures that referenced Configuration objects
are actually instantiated.
* Regenerate samples
* Add real assertions in DefaultCodegenTest.java testAllOfXXX methods
* Add test to DefaultCodegenTest for an allOf composition with a single ref and no own props
* Ensure model.parent is also added to model.allParents when multipleInheritance is supported
* Cleanup: remove LOGGER.debug, renamed refedParentNames to refedWithoutDiscriminator
* [core] Normalizing vendor extension naming
According to [OAS 2.0][1] and [OAS 3.0][2] Specifications:
> Allows extensions to the OpenAPI Schema. The field name MUST begin with x-,
> for example, x-internal-id. The value can be null, a primitive, an array or an object.
> Can have any valid JSON format value.
This commit attempts to define a [clear identifier design format][3] of
maintaining lower-kebab casing and following the x- prefix defined by
OAI Specification.
Following a convention that matches that used by others (see [autorest][4]), we will remove
any confusion about naming strategies for template authors and
customizers. Following the lower-kebab convention will allow us to
convert from camelCase and missing prefixes to the desired format. For
example, these conversions are simple to make for template consistency:
* customValue => x-custom-value
* x-customValue => x-custom-value
* x-custom-value => x-custom-value
This convention also allows us to define a single standard for use
across all generators. This means no occurrence of x-operationId in one
generator and x-operation-id in another.
[1]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#patterned-objects
[2]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specificationExtensions
[3]: https://tools.ietf.org/html/draft-wilde-registries-01#section-3.4
[4]: https://github.com/Azure/autorest/tree/master/docs/extensions
* Incorporate feedback to avoid race/blocking in OnceLogger
* Remove unnecessary additional log config
* Add tests,comments for OnceLogger
* Test caffeine cache with FakeTicker