Skip to content

Update ObjectSerializer.mustache #6769

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

Closed
wants to merge 1 commit into from

Conversation

Herrick19
Copy link
Contributor

When we deserialize a json structure, only the first level of validation is done and accessible with "listInvalidProperties"

To validate all sub objects, everyone would need to loop again on the objects and follow all properties, check if they are objects and call listInvalidProperties on each of them.

A better approach would be to have the "listInvalidProperties" shared between parent and childs, but this would be a major structural change so this easy fix seems like a nice compromise.

When we deserialize a json structure, only the first level of validation is done and accessible with "listInvalidProperties"

To validate all sub objects, everyone would need to loop again on the objects and follow all properties, check if they are objects and call listInvalidProperties on each of them.

A better approach would be to have the "listInvalidProperties" shared between parent and childs, but this would be a major structural change so this easy fix seems like a nice compromise.
@Herrick19 Herrick19 closed this Jun 24, 2020
@Herrick19 Herrick19 deleted the Herrick19-patch-2 branch June 24, 2020 17:32
@ybelenko
Copy link
Contributor

@Herrick19 Why did you decide to close this PR?

@Herrick19
Copy link
Contributor Author

Hi,

I Changed my mind and thought a separate function would be better.

So if you check this pr: #6770

It does the same thing but in a better way IMO

Best Regards

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