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

add type dsl to define property data type #22

Closed
syphax-bouazzouni opened this issue Feb 23, 2023 · 1 comment · Fixed by #23
Closed

add type dsl to define property data type #22

syphax-bouazzouni opened this issue Feb 23, 2023 · 1 comment · Fixed by #23
Assignees

Comments

@syphax-bouazzouni
Copy link

syphax-bouazzouni commented Feb 23, 2023

Requirement

Currently, to define a property type we use the enforce statement, like so

 attribute :uri, enforce:  [:URI, :existence, :unique]

The problem is that the validators (existence and uniqueness) are mixed with the property range (URI)

The proposition would be to add the 'type' argument and transform it like the following

 attribute :URI, type: :URI , enforce:  [:existence, :unique]

It will still be backward compatible because we it's only a redirection, i.e type: :uri will be added to the enforce clause in the back

@syphax-bouazzouni syphax-bouazzouni self-assigned this Feb 23, 2023
@syphax-bouazzouni syphax-bouazzouni changed the title add `type' dsl to define property data type add type dsl to define property data type Feb 23, 2023
@syphax-bouazzouni syphax-bouazzouni linked a pull request Feb 27, 2023 that will close this issue
@syphax-bouazzouni
Copy link
Author

implemented in #27

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

Successfully merging a pull request may close this issue.

1 participant