Skip to content

Commit

Permalink
Add union paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
mganss authored Jul 18, 2023
1 parent c60cc6e commit 7d60418
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ from schema restrictions
* Optionally generate interfaces for groups and attribute groups
* Optionally generate one file per class
* Support for nullable reference types (NRTs) through [`AllowNullAttribute`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.allownullattribute) and [`MaybeNullAttribute`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.maybenullattribute)
* Optionally generate a common specific type for union member types

Unsupported:

Expand Down Expand Up @@ -180,6 +181,9 @@ Options:
--ca, --commandArgs generate a comment with the exact command line
arguments that were used to generate the source
code (default is true)
--uc, --unionCommonType
generate a common type for unions if possible (
default is false)
```

For use from code use the [library NuGet package](https://www.nuget.org/packages/XmlSchemaClassGenerator-beta/):
Expand Down Expand Up @@ -432,6 +436,14 @@ If the range specified by `minInclusive` and `maxInclusive` does not fit in any
<tr><td>&gt;=29</td><td>string</td></tr>
</table>

Unions
------

If you specify `--unionCommonType`, XmlSchemaClassGenerator will try to determine a common type for a union's member types. If, for example, the member types
are all integer types, then the narrowest integer type will be used that can fit all member types.

Note that semantic issues might arise with this approach. For example, `DateTime` values are serialized with both date and time information included. See discussion at [#397](https://github.com/mganss/XmlSchemaClassGenerator/issues/397).

Contributing
------------

Expand Down

0 comments on commit 7d60418

Please sign in to comment.