Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liron-bar-mashiah opened this issue Jul 3, 2024 · 0 comments

Comments

@liron-bar-mashiah
Copy link

liron-bar-mashiah commented Jul 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant