-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
download attribute in project schema #713
base: main
Are you sure you want to change the base?
download attribute in project schema #713
Conversation
4ed7867
to
d38c1dc
Compare
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.
Could you add more test cases based on the field requirements?
I tried but how can I apply for array items, as there is no enum for it |
I'd like to have at least the following test cases:
|
okay |
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.
Please use alphabetical order for new attributes everywhere.
def validate_data(schema, data): | ||
# Perform URL validation before schema validation |
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.
Do we really need this?
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.
I think yes, If we detect invalid URLs in the downloads list before calling validate(), we can skip the full schema validation and return an error immediately.
This prevents unnecessary processing and speeds up validation.
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.
wdyt?
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.
In this particular case I'd prefer code readability vs validation performance. Out tests/validation speed is not a goal here, at least now.
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.
but currently there's no existing validation for URIs, then where we gonna add validation for it?
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.
We should extend the validator to cover URIs too then. Refer to the docs on how to do that.
…/schema-download-attribute
…shgoyal0110/Nest into fix/schema-download-attribute
fixes: #697