Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
595333c
Deletes additionalEnumTypeAnnotations
spacether Jan 5, 2024
1e1e7c0
Removes additionalModelTypeAnnotations
spacether Jan 5, 2024
5816c4b
Removes asyncNative
spacether Jan 5, 2024
4a637d9
Removes bigDecimalAsString
spacether Jan 5, 2024
eefdd73
Removes booleanGetterPrefix
spacether Jan 5, 2024
993eaec
Removes caseInsensitiveResponseHeaders
spacether Jan 5, 2024
17ac535
Removes configKey
spacether Jan 5, 2024
cc47a16
Removes dateLibrary
spacether Jan 5, 2024
0ca7a28
Removes disableHtmlEscaping
spacether Jan 5, 2024
1f75619
Removes discriminatorCaseSensitive
spacether Jan 5, 2024
0b2bc08
Removes dynamicOperations
spacether Jan 5, 2024
85f0e90
Removes ensureUniqueParams
spacether Jan 5, 2024
77eb178
Removes enumUnknownDefaultCase
spacether Jan 5, 2024
b015509
Removes errorObjectType
spacether Jan 5, 2024
2c7d897
Removes fullJavaUtil
spacether Jan 5, 2024
7020384
Removes gradleProperties
spacether Jan 5, 2024
93e1ce7
Removes ignoreAnyOfInEnum
spacether Jan 5, 2024
0086329
Removes implicitHeaders
spacether Jan 5, 2024
d3a56ff
Removes microprofileFramework
spacether Jan 5, 2024
d7c3528
Removes microprofileRestClientVersion
spacether Jan 5, 2024
7d964f7
Removes openApiNullable
spacether Jan 5, 2024
25f89f2
Removes parcelableModel
spacether Jan 5, 2024
dc8f6f1
Removes performBeanValidation
spacether Jan 5, 2024
d5cfd11
Removes prependFormOrBodyParameters
spacether Jan 5, 2024
92e78e4
Removes serializableModel
spacether Jan 5, 2024
39d25f8
Docs updated
spacether Jan 5, 2024
3353342
Removes disallowAdditionalPropertiesIfNotPresent
spacether Jan 5, 2024
5e9116d
Removes legacyDiscriminatorBehavior
spacether Jan 5, 2024
059da25
Fixes java tests
spacether Jan 5, 2024
395971c
Removes serializationLibrary
spacether Jan 5, 2024
0881ff9
Removes sortModelPropertiesByRequiredFlag
spacether Jan 5, 2024
70c6464
Removes sortParamsByRequiredFlag
spacether Jan 5, 2024
73176b6
Removes supportStreaming
spacether Jan 5, 2024
b7677f2
Removes useAbstractionForFiles
spacether Jan 5, 2024
b04c235
Removes useBeanValidation
spacether Jan 5, 2024
be177ee
Removes useGzipFeature
spacether Jan 5, 2024
6577c85
Removes useOneOfDiscriminatorLookup
spacether Jan 5, 2024
bfa2748
Removes usePlayWS
spacether Jan 5, 2024
b2b6e64
Removes useReflectionEqualsHashCode
spacether Jan 5, 2024
fa8449a
Removes useRuntimeException
spacether Jan 5, 2024
8af0837
Removes useRxJava2
spacether Jan 5, 2024
59efe84
Removes useRxJava3
spacether Jan 5, 2024
1554a66
Removes useSingleRequestParameter
spacether Jan 5, 2024
11db711
Removes withXml
spacether Jan 5, 2024
63fb578
Docs updated
spacether Jan 5, 2024
f4ad757
Removes library
spacether Jan 5, 2024
e47cdcd
Removes modelPackage
spacether Jan 5, 2024
1fd77de
Adjusts vendor extensions
spacether Jan 5, 2024
e959401
Removes unused libraries in java client
spacether Jan 5, 2024
9e96227
Java tests updated of tool
spacether Jan 5, 2024
1019f81
Sample regen
spacether Jan 5, 2024
9d20897
Updates java instantiationTypes
spacether Jan 5, 2024
45a1a7d
Java instantiation types updated
spacether Jan 5, 2024
c40ac8d
Removes type-mappings
spacether Jan 5, 2024
b29b4ae
Removes import-mappings
spacether Jan 5, 2024
3c0a100
Removes schemaMappings
spacether Jan 5, 2024
4afa67f
Removes inlineSchemaNameMappings
spacether Jan 5, 2024
ad42191
Removes inlineSchemaNameDefaults
spacether Jan 5, 2024
d3327a3
Removes reservedWordsMappings
spacether Jan 5, 2024
0cf3dd4
Removes instantiationTypes input
spacether Jan 5, 2024
f597cfb
Removes language-specific-primitives input
spacether Jan 5, 2024
4716f5a
Removes more inputs
spacether Jan 5, 2024
8d2ee56
Removes java test
spacether Jan 6, 2024
5d41411
Removes server-variables
spacether Jan 6, 2024
016ee39
Samples regen
spacether Jan 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,18 @@ SYNOPSIS
[--http-user-agent <http user agent>]
[(-i <spec file> | --input-spec <spec file>)]
[--ignore-file-override <ignore file override location>]
[--import-mappings <import mappings>...]
[--instantiation-types <instantiation types>...]
[--invoker-package <invoker package>]
[--language-specific-primitives <language specific primitives>...]
[--legacy-discriminator-behavior] [--library <library>]
[--log-to-stderr] [--minimal-update]
[--model-name-prefix <model name prefix>]
[--model-name-suffix <model name suffix>]
[--model-package <model package>]
[(-o <output directory> | --output <output directory>)] [(-p <additional properties> | --additional-properties <additional properties>)...]
[--package-name <package name>] [--release-note <release note>]
[--remove-operation-id-prefix]
[--reserved-words-mappings <reserved word mappings>...]
[(-s | --skip-overwrite)] [--server-variables <server variables>...]
[(-s | --skip-overwrite)]
[--skip-validate-spec] [--strict-spec <true/false strict behavior>]
[(-t <template directory> | --template-dir <template directory>)]
[--type-mappings <type mappings>...] [(-v | --verbose)]
[(-v | --verbose)]

OPTIONS
-a <authorization>, --auth <authorization>
Expand Down
1 change: 0 additions & 1 deletion bin/new_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public class ${lang_classname} extends DefaultCodegen implements CodegenConfig {
apiTemplateFiles.put("api.mustache", ".zz");
embeddedTemplateDir = templateDir = "${gen_name_camel}";
apiPackage = "Apis";
modelPackage = "Models";
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
// TODO: Fill this out.
}
Expand Down
362 changes: 0 additions & 362 deletions docs/3.0.0-release-note.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ For other languages, feel free to suggest.
You may find the current code base not 100% conform to the coding style and we welcome contributions to fix those.

For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions), please follow the naming convention below:
- For general vendor extension, use lower case and hyphen. e.g. `x-is-unique`, `x-content-type`
- For general vendor extension, use lower case and hyphen. e.g. `x-is-unique`,
- For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit`
- For a list of existing vendor extensions in use, please refer to https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.

Expand Down
88 changes: 2 additions & 86 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ You might have an external configuration file named `config.yaml` which defines
```yaml
additionalProperties:
artifactId: kotlin-petstore-client
serializableModel: "true"
dateLibrary: java8
```

You would generate via CLI with the command:
Expand All @@ -32,8 +30,6 @@ To support the above scenario with custom templates, ensure that you're pointing
templateDir: my_custom_templates
additionalProperties:
artifactId: kotlin-petstore-client
serializableModel: "true"
dateLibrary: java8
files:
AUTHORS.md: {}
api_interfaces.mustache:
Expand Down Expand Up @@ -310,22 +306,9 @@ Output

```
CONFIG OPTIONS
modelPackage
package for generated models

apiPackage
package for generated api classes
...... (results omitted)
library
library template (sub-template) to use:
jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
jersey2 - HTTP client: Jersey client 2.6
feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3
okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
rest-assured - HTTP client: rest-assured : 4.3.0. JSON processing: Gson 2.8.6. Only for Java8
```

Your config file for Java can look like
Expand All @@ -334,8 +317,7 @@ Your config file for Java can look like
{
"groupId":"com.my.company",
"artifactId":"MyClient",
"artifactVersion":"1.2.0",
"library":"feign"
"artifactVersion":"1.2.0"
}
```

Expand Down Expand Up @@ -371,72 +353,6 @@ and specify the `classname` when running the generator:

Your subclass will now be loaded and overrides the `PREFIX` value in the superclass.

## Bringing your own models

Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell
the codegen what _not_ to create. When doing this, every location that references a specific model will
refer back to your classes. Note, this may not apply to all languages...

To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such:

```
--import-mappings Pet=my.models.MyPet
```

Or for multiple mappings:

```
--import-mappings Pet=my.models.MyPet,Order=my.models.MyOrder
```
or
```
--import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder
```

## Schema Mapping

One can map the schema to someting else (e.g. external objects/models outside of the package) using the `schemaMappings` option, e.g. in CLI
```sh
java -jar target/openapi-generator-cli.jar generate -g java -i src/test/resources/3_0/type-alias.yaml -o /tmp/java2/ --schema-mapping TypeAlias=foo.bar.TypeAlias
```
Another example (in conjunction with --type-mappings):
```sh
java -jar target/openapi-generator-cli.jar generate -g java -i /tmp/alias.yaml -o /tmp/alias/ --schema-mappings stream=org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody --type-mappings string+binary=stream
```
while /tmp/alias.yaml is as follows:
```yaml
openapi: 3.0.3
info:
title: Demo app
version: 1.0.0
servers:
- url: /api/v1
paths:
/demo:
get:
summary: Demo
operationId: demo
responses:
'200':
description: Demo response
content:
text/csv:
schema:
type: string
format: binary
```

## Inline Schema Naming

Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option, e.g. in CLI

```
java -jar target/openapi-generator-cli.jar generate -g java -i src/test/resources/3_0/inline_model_resolver.yaml -o /tmp/java3/ --skip-validate-spec --inline-schema-name-mappings inline_object_2=SomethingMapped,inline_object_4=nothing_new
```

Another useful option is `inlineSchemaNameDefaults`, which allows you to customize the suffix of the auto-generated inline schema name, e.g. in CLI
```
--inline-schema-name-defaults arrayItemSuffix=_array_item
```

Note: Only arrayItemSuffix, mapItemSuffix are supported at the moment.
Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field
4 changes: 2 additions & 2 deletions docs/faq-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ config.templateDir = 'src/openapi-generator-templates/Java/libraries/feign
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/src/test/resources/3_0/petstore.json \
-l java --library=okhttp-gson \
-l java \
--additional-properties hideGenerationTimestamp=true \
-o /var/tmp/java/okhttp-gson/
```
Expand All @@ -56,7 +56,7 @@ To generate the Android SDK with [`volley`](https://github.com/mcxiaoke/android-
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/src/test/resources/3_0/petstore.json \
-l android --library=volley \
-l android \
-o /var/tmp/android/volley/
```
We do **not** recommend using the default HTTP library (Apache HttpClient) with `android` as it's not actively maintained.
Expand Down
Loading