Skip to content

Commit

Permalink
docs: Describe oneof=unions-value output as Algebraic Data Type (#1065
Browse files Browse the repository at this point in the history
)

The discriminated union output of `oneof=unions` and
`oneof=unions-value` is incorrectly described as an Abstract Data Type.
Describe as Algebraic Data Type instead.
  • Loading branch information
probeiuscorp authored Jun 28, 2024
1 parent 84ccaf2 commit 14e7e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ Will generate a `Foo` type with two fields: `field_a: string | undefined;` and `

With this output, you'll have to check both `if object.field_a` and `if object.field_b`, and if you set one, you'll have to remember to unset the other.

Instead, we recommend using the `oneof=unions-value` option, which will change the output to be an Abstract Data Type/ADT like:
Instead, we recommend using the `oneof=unions-value` option, which will change the output to be an Algebraic Data Type/ADT like:

```typescript
interface YourMessage {
Expand Down

0 comments on commit 14e7e0f

Please sign in to comment.