-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Do not restrict to canonical values #34
Labels
bug
Something isn't working
Comments
This test should pass: def test_canonical_values():
class Model(Resource):
class Foo(str, Enum):
bar = "bar"
baz = "baz"
schemas: List[str] = ["urn:example:2.0:Model"]
foo: Optional[Foo]
valid = Model(foo="bar")
assert valid.foo == "bar"
valid = Model(foo="invalid")
assert valid.foo is None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RFC7643 §2.3.1 indicates that string types with canonical values defined can or cannot have other values, depending on the server configuration:
In §7 it is indicated that values can be ignored:
Currently scim2_models defines custom enums, but that makes pydantic enforce those values only.
scim2-models/scim2_models/rfc7643/user.py
Lines 44 to 48 in 56287ad
scim2-models/scim2_models/rfc7643/user.py
Lines 56 to 57 in 56287ad
In that situation scim2-models should accept both arbitrary and enum values.
Also, when #6 is implemented, scim2-models should generate dynamic enums.
The text was updated successfully, but these errors were encountered: