Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6d49ec7
first commit, retrieving needed vars in mustache
basyskom-dege Jan 14, 2021
d602154
styling prefix, suffix, delim
basyskom-dege Jan 15, 2021
a4e98d9
finished path params and query params as array.
basyskom-dege Jan 18, 2021
fc8f991
Finished path,query,header except Objects
basyskom-dege Jan 22, 2021
8ed9f30
finished Object serialization for path,query and header params
basyskom-dege Jan 25, 2021
b609554
Cookie parameter
basyskom-dege Jan 26, 2021
57287cb
finished deepObjects. Refactoring template
basyskom-dege Jan 26, 2021
2684377
generated samples and docs. added GlobalFeature.ParamterStyling
basyskom-dege Jan 28, 2021
8f87516
resolved Conflicts
basyskom-dege Jan 28, 2021
236e00a
Merge branch 'master' into QtParameterStyling
basyskom-dege Jan 28, 2021
2553d05
Removes nulltype from python, updates samples (#8555)
spacether Jan 28, 2021
64f5dc8
[swift5] URLSession: Fix memory leak of SessionDelegate (#8558)
fl034 Jan 29, 2021
061552f
[feature][python-flask] Add CORS support to python-flask server (#8472)
ceresek Jan 29, 2021
a968fb1
make shebangs portable (#8556)
NANASHI0X74 Jan 29, 2021
57126a1
Add getters for private default Headers and authentications (#8509)
NANASHI0X74 Jan 29, 2021
f0b9e21
[Java] fix generation for JavaTimeFormatter (#8348)
borsch Jan 29, 2021
de40772
Add viadee logo (#8573)
wing328 Jan 29, 2021
1f8ceb9
update samples
wing328 Jan 29, 2021
a431241
[PYTHON] use customized default Configuration() objects if configured…
adpoliak Jan 30, 2021
5135967
[dart] Fix typo added in 57126a19 (#8581)
kuhnroyal Jan 30, 2021
328cadb
[Qt5][C++] Fixed QByteArray::toUtf8 with FILE as request body. Includ…
igor-sirotin Jan 30, 2021
c15a437
[Rust Server] Cargo Metadata Configuration (#8519)
richardwhiuk Jan 30, 2021
4ea4ceb
[Rust Server] Serializable responses (#8516)
richardwhiuk Jan 30, 2021
b4154be
[Rust Server] Add support for Bearer token authentication (#7840)
mattdowdell Jan 30, 2021
370d0e8
update samples
wing328 Jan 31, 2021
d36ce12
Add @kannkyo to JMeter tech committee (#8585)
wing328 Jan 31, 2021
6dee987
Fix auto-generated R doc (#8584)
wing328 Feb 1, 2021
c12f604
Added 'hash' to objcReservedWords (#8582)
Pe-te Feb 1, 2021
19f21ac
Fix handling of 1xx and 3xx in Rust Reqwest (#8574)
wing328 Feb 1, 2021
17ea152
fixed error in api body, updated samples
basyskom-dege Feb 1, 2021
2edf378
first commit, retrieving needed vars in mustache
basyskom-dege Jan 14, 2021
23bbab6
styling prefix, suffix, delim
basyskom-dege Jan 15, 2021
18e0ea3
finished path params and query params as array.
basyskom-dege Jan 18, 2021
c0be479
Finished path,query,header except Objects
basyskom-dege Jan 22, 2021
2cf3f1b
finished Object serialization for path,query and header params
basyskom-dege Jan 25, 2021
527da47
Cookie parameter
basyskom-dege Jan 26, 2021
49d33a4
finished deepObjects. Refactoring template
basyskom-dege Jan 26, 2021
3775a71
generated samples and docs. added GlobalFeature.ParamterStyling
basyskom-dege Jan 28, 2021
07e0382
resolved Conflicts
basyskom-dege Jan 28, 2021
d706de8
fixed error in api body, updated samples
basyskom-dege Feb 1, 2021
d488527
merge
basyskom-dege Feb 1, 2021
c08b57f
first commit, retrieving needed vars in mustache
basyskom-dege Jan 14, 2021
e99718b
styling prefix, suffix, delim
basyskom-dege Jan 15, 2021
bcf7ef9
finished path params and query params as array.
basyskom-dege Jan 18, 2021
3490831
Finished path,query,header except Objects
basyskom-dege Jan 22, 2021
cc958fd
finished Object serialization for path,query and header params
basyskom-dege Jan 25, 2021
bdcbf6c
Cookie parameter
basyskom-dege Jan 26, 2021
ca7d54a
finished deepObjects. Refactoring template
basyskom-dege Jan 26, 2021
b0edb5d
generated samples and docs. added GlobalFeature.ParamterStyling
basyskom-dege Jan 28, 2021
6245a96
resolved Conflicts
basyskom-dege Jan 28, 2021
543db7c
fixed error in api body, updated samples
basyskom-dege Feb 1, 2021
1bef202
Merge branch 'QtParameterStyling' of https://github.com/basyskom-dege…
basyskom-dege Feb 1, 2021
999bbdc
finished Rebase
basyskom-dege Feb 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div align="center">

[![Stable releaases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) ![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator)
[![Stable releaases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator)

</div>

Expand Down Expand Up @@ -998,7 +998,7 @@ If you want to join the committee, please kindly apply by sending an email to te

#### Members of Technical Committee

| Languages | Member (join date) |
| Languages/Generators | Member (join date) |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ActionScript | |
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
Expand All @@ -1020,6 +1020,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Groovy | |
| Haskell | |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) |
| JMeter | @kannkyo (2021/01) |
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) |
| Lua | @daurnimator (2017/08) |
| Nim | |
Expand Down
11 changes: 11 additions & 0 deletions bin/configs/java-jersey2-java8-localdatetime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: java
outputDir: samples/client/petstore/java/jersey2-java8-localdatetime
library: jersey2
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-jersey2-java8-localdatetime
hideGenerationTimestamp: "true"
dateLibrary: java8-localdatetime
java8: true
delegatePattern: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ generateAliasAsModel: true
additionalProperties:
hideGenerationTimestamp: "true"
packageName: petstore-with-fake-endpoints-models-for-testing
publishRustRegistry: crates-io
8 changes: 8 additions & 0 deletions bin/configs/rust-server-ping-bearer-auth-v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generatorName: rust-server
outputDir: samples/server/petstore/rust-server/output/ping-bearer-auth
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
templateDir: modules/openapi-generator/src/main/resources/rust-server
generateAliasAsModel: true
additionalProperties:
hideGenerationTimestamp: "true"
packageName: ping-bearer-auth
4 changes: 2 additions & 2 deletions bin/utils/export_docs_generators.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

SCRIPT="$0"
echo "# START SCRIPT: ${SCRIPT}"
Expand All @@ -17,4 +17,4 @@ do
((i=i%N)); ((i++==0)) && wait
./bin/utils/export_generator.sh ${GENERATOR} &
done
)
)
2 changes: 1 addition & 1 deletion bin/utils/export_generator.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

SCRIPT="$0"

Expand Down
2 changes: 1 addition & 1 deletion docs/generators/cpp-qt5-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✓|OAS3
|ParameterizedServer|✓|OAS3
|ParameterStyling||OAS3
|ParameterStyling||OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3

Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-aiohttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-blueplanet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/rust-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken||OAS3
|BearerToken||OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
public static final String CONTROLLER_PACKAGE = "controllerPackage";
public static final String DEFAULT_CONTROLLER = "defaultController";
public static final String SUPPORT_PYTHON2 = "supportPython2";
public static final String FEATURE_CORS = "featureCORS";
// nose is a python testing framework, we use pytest if USE_NOSE is unset
public static final String USE_NOSE = "useNose";
public static final String PYTHON_SRC_ROOT = "pythonSrcRoot";
Expand All @@ -61,6 +62,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
protected String defaultController;
protected Map<Character, String> regexModifiers;
protected boolean fixBodyName;
protected boolean featureCORS = Boolean.FALSE;
protected boolean useNose = Boolean.FALSE;
protected String pythonSrcRoot;

Expand Down Expand Up @@ -165,6 +167,8 @@ public AbstractPythonConnexionServerCodegen(String templateDirectory, boolean fi
defaultValue("false"));
cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run").
defaultValue("8080"));
cliOptions.add(CliOption.newBoolean(FEATURE_CORS, "use flask-cors for handling CORS requests").
defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
defaultValue(Boolean.FALSE.toString()));
cliOptions.add(new CliOption(PYTHON_SRC_ROOT, "put python sources in this subdirectory of output folder (defaults to \"\" for). Use this for src/ layout.").
Expand Down Expand Up @@ -213,6 +217,9 @@ public void processOpts() {
additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE);
typeMapping.put("long", "long");
}
if (additionalProperties.containsKey(FEATURE_CORS)) {
setFeatureCORS((String) additionalProperties.get(FEATURE_CORS));
}
if (additionalProperties.containsKey(USE_NOSE)) {
setUseNose((String) additionalProperties.get(USE_NOSE));
}
Expand All @@ -236,6 +243,10 @@ public void processOpts() {
controllerPackage = packageName + "." + controllerPackage;
}

public void setFeatureCORS(String val) {
this.featureCORS = Boolean.valueOf(val);
}

public void setUseNose(String val) {
this.useNose = Boolean.valueOf(val);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public CppQt5ClientCodegen() {
.includeSecurityFeatures(SecurityFeature.BasicAuth)
.includeSecurityFeatures(SecurityFeature.ApiKey)
.includeSecurityFeatures(SecurityFeature.BearerToken)
.includeGlobalFeatures(GlobalFeature.ParameterStyling)
);

// set the output folder here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
}

if (dateLibrary.equals("java8") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY2))) {
// helper for client library that allow to parse/format java.time.OffsetDateTime or org.threeten.bp.OffsetDateTime
if (additionalProperties.containsKey("jsr310") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY1) || isLibrary(JERSEY2))) {
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,14 @@ public void postProcessParameter(CodegenParameter p) {
}
}

private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result) {
private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) {
// for composed schema models, if the required properties are only from oneOf or anyOf models
// give them a nulltype.Null so the user can omit including them in python
// remove them from the composed schema's required vars
// for composed schemas our code adds oneOf and anyOf required properties to
// the composed schema's required properties
// but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB
// and the required props are only in schemaB, we do not need to use them when making an instance of
// ComposedSchema + schemaA
ComposedSchema cs = (ComposedSchema) schema;

// these are the properties that are from properties in self cs or cs allOf
Expand Down Expand Up @@ -596,7 +601,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu

List<Schema> allOf = cs.getAllOf();
if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) {
// NOTE: this function also adds the allOf propesrties inside schema
// NOTE: this function also adds the allOf properties inside schema
addProperties(selfProperties, selfRequired, schema);
}
if (result.discriminator != null) {
Expand All @@ -605,16 +610,20 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu
Set<String> selfRequiredSet = new HashSet<String>(selfRequired);

List<CodegenProperty> reqVars = result.getRequiredVars();
List<CodegenProperty> reqVarsThatMustBeOptional = new ArrayList<>();
if (reqVars != null) {
for (CodegenProperty cp : reqVars) {
String propName = cp.baseName;
if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) {
// if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars
// then set it to nullable because the user doesn't have to give a value for it
cp.setDefaultValue("nulltype.Null");
cp.required = false;
reqVarsThatMustBeOptional.add(cp);
}
}
}
for (CodegenProperty cp : reqVarsThatMustBeOptional) {
result.getRequiredVars().remove(cp);
result.getOptionalVars().add(cp);
}
}

/**
Expand Down Expand Up @@ -643,7 +652,7 @@ protected void addParentContainer(CodegenModel model, String name, Schema schema
public CodegenModel fromModel(String name, Schema sc) {
CodegenModel cm = super.fromModel(name, sc);
if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) {
addNullDefaultToOneOfAnyOfReqProps(sc, cm);
fixComposedSchemaRequiredVars(sc, cm);
}
ArrayList<List<CodegenProperty>> listOfLists = new ArrayList<List<CodegenProperty>>();
listOfLists.add(cm.requiredVars);
Expand Down
Loading