-
Notifications
You must be signed in to change notification settings - Fork 0
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
Chore/sof 6429 #41
Chore/sof 6429 #41
Conversation
* @param {Object[]} nodes - Array of nodes (e.g. `[tree]` or `node.children`) | ||
* @returns {{}|{dependencies: {}}} | ||
*/ | ||
export function buildDependenciesOneOf(nodes) { |
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.
Should we move this to a file named tree.js
?
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.
It makes use of a tree structure, yes, but the result of this function is really only useful in the context of schemas. In my opinion, it is already in a good place.
tests/utils.schemas.tests.js
Outdated
modifyProperties: true, | ||
useEnum: false, | ||
}); | ||
// console.log(JSON.stringify(rjsfSchema, null, 4)); |
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.
Remove
value: "data.functional.slug", | ||
name: "data.functional.name", | ||
value: "data.functional.enum[0]", | ||
name: "data.functional.title", |
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.
Per our discussion:
- Let's add type to know whether we are dealing with a string or object for enum[0] use
- When object, we can have
value: data.functional
,name: data.functional.name
This PR concerns the addition of a second function to generate the
dependencies
block using"oneOf"
instead of"enum"
.