Repository navigation
fix(scim): keep lists of plain values flat in snake_cased_body #1973
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,7 @@ def test_snake_cased(self): | |
| result = _to_snake_cased(json.loads(response_body)) | ||
| self.assertEqual(result["start_index"], 1) | ||
| self.assertIsNotNone(result["resources"][0]["id"]) | ||
|
|
||
| def test_snake_cased_list_of_plain_values(self): | ||
| result = _to_snake_cased({"schemas": ["urn:scim:schemas:core:1.0", "urn:scim:schemas:extension:enterprise:1.0"]}) | ||
| self.assertEqual(result["schemas"], ["urn:scim:schemas:core:1.0", "urn:scim:schemas:extension:enterprise:1.0"]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: This covers the helper well. Could we also pin the user-facing symptom? user = response.users[0]
self.assertEqual(user.schemas, ["urn:scim:schemas:core:1.0"])That way a future change to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added in 7f59173. One note: |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Nice catch, this is the right fix. Copying
elementinstead oforiginal_valuekeeps the list flat and leaves the list-of-dicts branch untouched.