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

The Jobs feature should enforce schema similarly across all interfaces (UI/ReST/ORM?) #651

Closed
jmcgill298 opened this issue Jul 6, 2021 · 2 comments · Fixed by #828
Closed
Labels
type: bug Something isn't working as expected

Comments

@jmcgill298
Copy link
Contributor

Environment

  • Python version: 3.8
  • Nautobot version: 1.0.2

Steps to Reproduce

  1. Create a Job with field constraints
  2. Take any necessary steps to have job in Web/Worker instances
  3. Fill out form and notice that the form will not submit until data complies with defined constraints per field
  4. Make ReST API call to the job with incorrect data and see that non-compliant data did not prevent the job from being sent to the worker

Expected Behavior

I expected to have a 400 Error and the job not be sent to the worker

Observed Behavior

The job was sent to the worker and the job failed due to invalid data.

@jmcgill298
Copy link
Contributor Author

Where the description states specifically that this is related to individual field type data, I should also point out that this also goes for the required-ness of the fields. It is also acceptable using the REST interface to not send fields that are required per the Job Field specification.

Another to point out is that Fields that define a default value do not have that default value supplied via the REST interface. The default does not actually act like a default, but just a pre-filled form entry.

In regards to this point, there should be some consideration as to what the data arg should do for non-required fields. It would be a convenience to developers to have all non-required and non-supplied fields default to None; this is the current behavior in the UI.

@glennmatthews glennmatthews added type: bug Something isn't working as expected status: accepted labels Jul 11, 2021
@glennmatthews
Copy link
Contributor

Most likely this will be addressed by adding an appropriate implementation of validate() and/or validate_data() on the JobInputSerializer class.

jathanism added a commit that referenced this issue Sep 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants