Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1c46afb
Add initial refactoring
ahmednfwela May 11, 2023
7000179
regenerate samples
ahmednfwela May 11, 2023
13b1186
completely decouple the networking and serialization mustache files i…
ahmednfwela May 13, 2023
041ec5a
fix typo
ahmednfwela May 13, 2023
9ca6a7e
gen samples
ahmednfwela May 13, 2023
8d4f73c
update tests to include new option
ahmednfwela May 13, 2023
b7d7e76
merge test schemas
ahmednfwela May 13, 2023
72bd9d4
merge test schema
ahmednfwela May 13, 2023
7b3715f
WIP
ahmednfwela May 13, 2023
9b6e6aa
fix pom location
ahmednfwela May 13, 2023
7893bd6
fix pom locations
ahmednfwela May 13, 2023
5e6d2de
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
ahmednfwela May 13, 2023
c4b5c2b
WIP test improvements
ahmednfwela May 13, 2023
9956785
don't exclude tests from analysis options
ahmednfwela May 13, 2023
34760b5
remove TODOs from test projects
ahmednfwela May 13, 2023
3336772
gen samples
ahmednfwela May 13, 2023
244ca74
WIP blocked by #10189
ahmednfwela May 14, 2023
93386c3
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
ahmednfwela Jun 15, 2023
26034cb
introduce dart-next
ahmednfwela Jun 17, 2023
580ce70
add back original files
ahmednfwela Jun 17, 2023
0196789
Add back original files
ahmednfwela Jun 17, 2023
64997ea
update pom for CI
ahmednfwela Jun 17, 2023
2676a8b
fix tests abd paths
ahmednfwela Jun 17, 2023
565e242
gen samples
ahmednfwela Jun 17, 2023
491d0bf
update docs
ahmednfwela Jun 17, 2023
4948432
update configs
ahmednfwela Jun 17, 2023
46401f3
fix pom paths
ahmednfwela Jun 17, 2023
13ff9b9
mark dart-next as experimental
ahmednfwela Jun 17, 2023
0f58020
Regenerate generator readme
kuhnroyal Jul 3, 2023
2f2f528
Improve sample execution
kuhnroyal Jul 3, 2023
8e599cb
Nit picks
kuhnroyal Jul 3, 2023
49b4983
fix part generation
ahmednfwela Aug 2, 2023
c9fb20e
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
ahmednfwela Aug 2, 2023
f5236ef
async changes
ahmednfwela Aug 2, 2023
9303787
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
ahmednfwela Jun 12, 2024
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
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/.test/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@
"Client: Dart"
]
},
{
"input": "dart-next-petstore.sh",
"matches": [
"Client: Dart"
]
},
{
"input": "dart-petstore.sh",
"matches": [
Expand Down
15 changes: 15 additions & 0 deletions bin/configs/dart-next-dio-built_value-v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
generatorName: dart-next
outputDir: samples/client/echo_api/dart/dio/built_value
inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-next
typeMappings:
Client: "ModelClient"
File: "ModelFile"
EnumClass: "ModelEnumClass"
additionalProperties:
hideGenerationTimestamp: "true"
enumUnknownDefaultCase: "true"
library: dio
serializationLibrary: built_value
reservedWordsMappings:
class: "classField"
13 changes: 13 additions & 0 deletions bin/configs/dart-next-dio-json_serializable-v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
generatorName: dart-next
outputDir: samples/client/echo_api/dart/dio/json_serializable
inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-next
typeMappings:
Client: "ModelClient"
File: "ModelFile"
EnumClass: "ModelEnumClass"
additionalProperties:
hideGenerationTimestamp: "true"
enumUnknownDefaultCase: "true"
library: dio
serializationLibrary: json_serializable
1 change: 1 addition & 0 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following generators are available:
* [csharp](generators/csharp.md)
* [dart](generators/dart.md)
* [dart-dio](generators/dart-dio.md)
* [dart-next (experimental)](generators/dart-next.md)
* [eiffel](generators/eiffel.md)
* [elixir](generators/elixir.md)
* [elm](generators/elm.md)
Expand Down
1 change: 1 addition & 0 deletions docs/generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following generators are available:
* [csharp-functions](csharp-functions.md)
* [dart](dart.md)
* [dart-dio](dart-dio.md)
* [dart-next](dart-next.md)
* [eiffel](eiffel.md)
* [elixir](elixir.md)
* [elm](elm.md)
Expand Down
257 changes: 257 additions & 0 deletions docs/generators/dart-next.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
---
title: Documentation for the dart-next Generator
---

## METADATA

| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | dart-next | pass this to the generate command after -g |
| generator stability | EXPERIMENTAL | |
| generator type | CLIENT | |
| generator language | Dart | |
| generator default templating engine | mustache | |
| helpTxt | Generates a Dart client library. | |

## CONFIG OPTIONS
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|dateLibrary|Specify Date library|<dl><dt>**core**</dt><dd>[DEFAULT] Dart core library (DateTime)</dd><dt>**timemachine**</dt><dd>Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.</dd></dl>|core|
|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|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true|
|legacyDiscriminatorBehavior|Set to false 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|
|library|Specify networking library|<dl><dt>**dio**</dt><dd>[DEFAULT] dio</dd><dt>**http**</dt><dd>[BETA] http</dd></dl>|dio|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|pubAuthor|Author name in generated pubspec| |Author|
|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
|pubDescription|Description in generated pubspec| |OpenAPI API client|
|pubHomepage|Homepage in generated pubspec| |homepage|
|pubLibrary|Library name in generated code| |openapi.api|
|pubName|Name in generated pubspec| |openapi|
|pubPublishTo|Publish_to in generated pubspec| |null|
|pubRepository|Repository in generated pubspec| |null|
|pubVersion|Version in generated pubspec| |1.0.0|
|serializationLibrary|Specify serialization library|<dl><dt>**built_value**</dt><dd>[DEFAULT] built_value</dd><dt>**json_serializable**</dt><dd>[BETA] json_serializable</dd></dl>|built_value|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|

## IMPORT MAPPING

| Type/Alias | Imports |
| ---------- | ------- |


## INSTANTIATION TYPES

| Type/Alias | Instantiated By |
| ---------- | --------------- |


## LANGUAGE PRIMITIVES

<ul class="column-ul">
<li>String</li>
<li>bool</li>
<li>double</li>
<li>int</li>
<li>num</li>
</ul>

## RESERVED WORDS

<ul class="column-ul">
<li>abstract</li>
<li>as</li>
<li>assert</li>
<li>async</li>
<li>await</li>
<li>break</li>
<li>case</li>
<li>catch</li>
<li>class</li>
<li>const</li>
<li>continue</li>
<li>covariant</li>
<li>default</li>
<li>deferred</li>
<li>do</li>
<li>dynamic</li>
<li>else</li>
<li>enum</li>
<li>export</li>
<li>extends</li>
<li>extension</li>
<li>external</li>
<li>factory</li>
<li>false</li>
<li>final</li>
<li>finally</li>
<li>for</li>
<li>function</li>
<li>get</li>
<li>hide</li>
<li>if</li>
<li>implements</li>
<li>import</li>
<li>in</li>
<li>inout</li>
<li>interface</li>
<li>is</li>
<li>late</li>
<li>library</li>
<li>mixin</li>
<li>native</li>
<li>new</li>
<li>null</li>
<li>of</li>
<li>on</li>
<li>operator</li>
<li>out</li>
<li>part</li>
<li>patch</li>
<li>required</li>
<li>rethrow</li>
<li>return</li>
<li>set</li>
<li>show</li>
<li>source</li>
<li>static</li>
<li>super</li>
<li>switch</li>
<li>sync</li>
<li>this</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typedef</li>
<li>var</li>
<li>void</li>
<li>while</li>
<li>with</li>
<li>yield</li>
</ul>

## FEATURE SET


### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✓|ToolingExtension
|Authorizations|✓|ToolingExtension
|UserAgent|✓|ToolingExtension
|MockServer|✗|ToolingExtension

### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Uuid|✗|
|Array|✓|OAS2,OAS3
|Null|✗|OAS3
|AnyType|✗|OAS2,OAS3
|Object|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension

### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension

### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✓|OAS3

### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✓|OAS2,OAS3
|Union|✓|OAS3
|allOf|✓|OAS2,OAS3
|anyOf|✓|OAS3
|oneOf|✓|OAS3
|not|✗|OAS3

### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|SignatureAuth|✗|OAS3

### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✗|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3
Loading