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

Fix for issue-33 : handling required field #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ssahayaraj8777
Copy link
Collaborator

This is the fix for setting fields as required. It works fine even after converting to OASv3.x, please review..

@@ -250,6 +252,16 @@ protected Pair prop(DataSchemaNode node) {
} else if (node instanceof LeafSchemaNode) {
LeafSchemaNode lN = (LeafSchemaNode) node;
prop = getPropertyByType(lN);
if (prop != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you decided to set required only for simple fields? Swagger allows you to define it at any property as well as YANG defines it at DataSchemaNode so it can be applied for all types of nodes

Copy link
Collaborator

@bartoszm bartoszm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution - so far so good.
However, I have a suggestion for how the required field should be implemented.
In addition, I would expect to see unit tests for the functionality you add.

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

Successfully merging this pull request may close these issues.

2 participants