@@ -401,33 +401,43 @@ Machinery before moving forward.
401
401
but all union member fields are null? This likely implies that the client cleared
402
402
the union member unintentionally, given that the discriminator value remains.
403
403
Should the server:
404
+
404
405
a. Error loudly and inform the client that the field pointed to by the
405
406
discriminator is null?
407
+
406
408
b. Retain the previously set member field, present on the old object, absent
407
409
from the new object, but pointed to by the discriminator?
408
- 2 . What should the value of the discriminator be when no field in the union is
409
- to be set (i.e for optional unions).
410
- a. mandate that the discriminator is the empty string for all optional unions?
411
- b. make the field specified on a per union basis (defined in the go markers)?
412
- c. mandate that the discriminator be unset (thus make the discriminator an
413
- optional field for optional unios)?
414
- 3 . How should a server behave when it receives a union with multiple fields set
410
+ 2 . How should a server behave when it receives a union with multiple fields set
415
411
and the discriminator modified to point to the newly set member field?
412
+
416
413
a. reject the request,
414
+
417
415
b. accept the request but don't clear any fields
416
+
418
417
c. accept the request and clear all the fields except the one chosen by the
419
418
discriminator
420
- 4 . Given that we want to migrate at least one existing union to use the new
421
- semantics, which union should we do? Must we upgrade both a discriminated and
422
- non-discriminated union for alpha or is only upgrading an existing
423
- discriminated union sufficient? Thoughts on my proposed types of
424
- ` MetricStatus ` (discriminated) and ` ContainerState ` (non-discriminated).
425
- 5 . What should we default the discriminator value of a member field to if not
419
+ 3 . What should the value of the discriminator be when no field in the union is
420
+ to be set (i.e for optional unions).
421
+
422
+ a. mandate that the discriminator is the empty string for all optional unions?
423
+
424
+ b. make the field specified on a per union basis (defined in the go markers)?
425
+
426
+ c. mandate that the discriminator be unset (thus make the discriminator an
427
+ optional field for optional unions)?
428
+ 4 . What should we default the discriminator value of a member field to if not
426
429
specified in the go markers?
430
+
427
431
a. the json representation of the field name
432
+
428
433
b. the go representation of the field name
429
434
Should we even give users the ability to define it or just stick to whatever
430
435
we decide the default is?
436
+ 5 . Given that we want to migrate at least one existing union to use the new
437
+ semantics, which union should we do? Must we upgrade both a discriminated and
438
+ non-discriminated union for alpha or is only upgrading an existing
439
+ discriminated union sufficient? Thoughts on my proposed types of
440
+ ` MetricStatus ` (discriminated) and ` ContainerState ` (non-discriminated).
431
441
432
442
### Test Plan
433
443
0 commit comments