Skip to content

Commit

Permalink
one more pass at defaultversion stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
duglin committed Feb 7, 2025
1 parent dbcefc6 commit bea421d
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions core/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3848,33 +3848,31 @@ and the following Resource level attributes:
- If present, it MUST be a case sensitive `true` or `false`.
- If present in a request, a value of `null` has the same meaning as
deleting the attribute, implicitly setting it to `false`.
- Since this attribute and `defaultversionid` can impact each other, their
processing is described by the following:
- When `PATCH` is used:
- If only `defaultversionid` is present in the request, and it has a
non-null value, then the sticky feature MUST be turned on. Otherwise,
a `null` value MUST result in the sticky feature being turned off.
- If only `defaultversionsticky` is present in the request, and it has a
value of `true`, then the current `defaultversionid` MUST become
sticky. Otherwise, a value of `false` MUST result in the sticky
feature being turned off.
- If both attributes are present in the request, then an error MUST be
generated if `defaultversionsticky` is `false` and `defaultversionid`
is non-null and not the newest Version. If `defaultversionsticky` is
`true` and `defaultversionid` is `null`, then the newest Version MUST
become the default Version and sticky.
- The processing of the `defaultversionsticky` and `defaultversionid`
attributes are related, and is described as follows:
- When `PATCH` is used but only one of the two attributes is specified
in the request, then:
- A non-`null` `defaultversionid` MUST result in processing as if
`defaultversionsticky` has a value of `true`.
- A `null` `defaultversionid` MUST result in processing as if
`defaultversionsticky` has a value of `false`.
- A `null` or `false` `defaultversionsticky` MUST result in processing
as if `defaultversionid` has a value of `null`.
- The processing then continues on the patched `meta` sub-object as if
`PUT` or `POST` was used.
- When `PUT` or `POST` is used:
- If `defaultversionsticky` is `false` (explicitly or absent) and
`defaultversionid` is a non-null value, then an error MUST be
generated if its value is not the newest Version.
- If `defaultversionsticky` is `true` and `defaultversionid` is `null`
(explicitly or absent), then the newest Version MUST become the
default Version and sticky.
- In all cases, a reference to a non-existing Version MUST generate an
error.
- For clarity, if the net result of the processing is that the sticky
feature is turned off, then the `defaultversionid` attribute MUST
reference the newest Version.
- A `null` or absent `defaultversionid` in the request MUST result in the
same semantics as it referencing "the newest Version".
- A `null` or absent `defaultversionsticky` in the request MUST result in
the same semantics as it being set to `false`.
- A `defaultversionid` referencing a non-existing Version MUST generate
an error.
- If `defaultversionsticky` is `false` and `defaultversionid` does not
reference the newest Version then an error MUST be generated, as this
would result in an inconsistent state.
- For clarity, if the net result of the processing is that the sticky
feature is turned off, then the `defaultversionid` MUST reference the
newest Version.
- Examples:
- `true`, `false`

Expand Down

0 comments on commit bea421d

Please sign in to comment.