Skip to content

Commit 5c70601

Browse files
committed
Add documentation for useOptional and patchOnly options
1 parent 57a8568 commit 5c70601

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

docs/generators/dart-dio.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2626
|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|<dl><dt>**default**</dt><dd>[DEFAULT] Built in hash code generation method</dd><dt>**equatable**</dt><dd>Uses equatable library for equality checking</dd></dl>|default|
2727
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true|
2828
|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|
29+
|patchOnly|Only apply Optional&lt;T&gt; to PATCH operation request bodies (requires useOptional=true)| |false|
2930
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
3031
|pubAuthor|Author name in generated pubspec| |Author|
3132
|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
@@ -42,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4243
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4344
|sourceFolder|source folder for generated code| |src|
4445
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|
46+
|useOptional|Use Optional&lt;T&gt; to distinguish absent, null, and present for optional fields (Dart 3+)| |false|
4547

4648
## IMPORT MAPPING
4749

docs/generators/dart.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2323
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
2424
|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|
2525
|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|
26+
|patchOnly|Only apply Optional&lt;T&gt; to PATCH operation request bodies (requires useOptional=true)| |false|
2627
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2728
|pubAuthor|Author name in generated pubspec| |Author|
2829
|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
@@ -38,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3839
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
3940
|sourceFolder|source folder for generated code| |src|
4041
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|
42+
|useOptional|Use Optional&lt;T&gt; to distinguish absent, null, and present for optional fields (Dart 3+)| |false|
4143

4244
## IMPORT MAPPING
4345

0 commit comments

Comments
 (0)