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

NSFS | NC | Schema Changes (Mainly in nsfs_config_schema) #7874

Closed
shirady opened this issue Mar 7, 2024 · 1 comment · Fixed by #7889
Closed

NSFS | NC | Schema Changes (Mainly in nsfs_config_schema) #7874

shirady opened this issue Mar 7, 2024 · 1 comment · Fixed by #7889
Assignees
Labels

Comments

@shirady
Copy link
Contributor

shirady commented Mar 7, 2024

Environment info

  • NooBaa Version: master
  • Platform: NSFS | NC

Actual behavior

  1. Currently we don't use strictify on nsfs_config_schema.
  2. Currently we use ajv.validate(schema_name, object_to_validate) and it doesn't align with the avj documentation (here), please notice the comment "Best performance: compile and getSchema methods".

Expected behavior

  1. Use strictify on nsfs_config_schema with additionalProperties: true.
  2. Compile the validate function once and re-use it (details in the link attached above).

Steps to reproduce

  1. none (internal change).

More information - Screenshots / Logs / Other output

Notes:
Currently, we would get errors trying to strictify on nsfs_config_schema. Partial things I found:

  • The schema uses default keyword which we didn't have in our past schemas (probably need to edit strictify for that case).
  • The schema uses description which is unknown keyword, and can be replaced with doc.
  • The schema uses array, but does not use items under it.
  • Might need general refactoring in the nsfs_config_schema so we would not get errors on strictify.
@shirady
Copy link
Contributor Author

shirady commented Mar 12, 2024

I plan to separate this fix into 2 PRs:

  1. Align with avj documentation as mentioned (use compile and reuse validate function).
  2. strictify on nsfs_config_schema with needed changes to the nsfs_config_schema.

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

Successfully merging a pull request may close this issue.

1 participant