Skip to content

Commit 7d09cfc

Browse files
committed
rearrange open questions
1 parent 3e4b476 commit 7d09cfc

File tree

1 file changed

+23
-13
lines changed
  • keps/sig-api-machinery/1027-api-unions

1 file changed

+23
-13
lines changed

keps/sig-api-machinery/1027-api-unions/README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,33 +401,43 @@ Machinery before moving forward.
401401
but all union member fields are null? This likely implies that the client cleared
402402
the union member unintentionally, given that the discriminator value remains.
403403
Should the server:
404+
404405
a. Error loudly and inform the client that the field pointed to by the
405406
discriminator is null?
407+
406408
b. Retain the previously set member field, present on the old object, absent
407409
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
415411
and the discriminator modified to point to the newly set member field?
412+
416413
a. reject the request,
414+
417415
b. accept the request but don't clear any fields
416+
418417
c. accept the request and clear all the fields except the one chosen by the
419418
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
426429
specified in the go markers?
430+
427431
a. the json representation of the field name
432+
428433
b. the go representation of the field name
429434
Should we even give users the ability to define it or just stick to whatever
430435
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).
431441

432442
### Test Plan
433443

0 commit comments

Comments
 (0)