cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

CreateOnly properties changing on update causing contract tests fail on wrong error

Open liron-bar-mashiah opened this issue 1 year ago • 0 comments

While trying to update a CreateOnlyProperty on the update contract, the expectation is to get the following error: AssertionError: Any createOnlyProperties specified in update handler input MUST NOT be different from their previous state

When the CreateOnlyProperty is an object and one of its fields was modified in the update contract I'm getting the following error: AssertionError: All properties specified in the request MUST be present in the model returned, and they MUST match exactly, with the exception of properties defined as writeOnlyProperties in the resource schema

updating a primitive property (e.g. string) for example:

  "prop": {
      "type": "string",
  },

will lead to the expected error.

updating an object property field for example:

  "prop": {
      "type": "object",
      "properties": {
          "a": {
              "type": "string"
          },
          "b": {
              "type": "string"
          }
      },
      "additionalProperties": false
  },

in case the update contract updates "a" or "b" the second error is issued.

liron-bar-mashiah avatar Jul 03 '24 12:07 liron-bar-mashiah