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 the SchemaPropsOptions POJO, which getRequired() getter returns the wrong field value #4395

Conversation

fabiobrz
Copy link
Contributor

@fabiobrz fabiobrz commented Sep 6, 2022

Description

This PR fixes the AbstractJsonSchema.SchemaPropsOptions.getRequired() method in order to return the required field value, rather than the nullable one.

Fixes #4394

FYI @andreaTP, @manusa

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • N/A - I have implemented unit tests to cover my changes
  • N/A - I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

Copy link
Member

@andreaTP andreaTP left a comment

Choose a reason for hiding this comment

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

Thanks @fabiobrz !

@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@fabiobrz fabiobrz marked this pull request as ready for review September 6, 2022 09:30
@andreaTP
Copy link
Member

andreaTP commented Sep 7, 2022

Looking at it again, and wondering how can I have missed this in the tests ... I'm pretty sure this is covered ...

@andreaTP andreaTP merged commit f4dcd32 into fabric8io:master Sep 7, 2022
@fabiobrz
Copy link
Contributor Author

fabiobrz commented Sep 7, 2022

Looking at it again, and wondering how can I have missed this in the tests ... I'm pretty sure this is covered ...

Hi @andreaTP - I thought about a simple unit test involving just the POJO itself, but then I thought that such principle should be extended to any bare POJOs that we use as property bags. Which definitely doesn't seem so good in terms of ROI.

I am doing some similar changes for java-gen, though, and will most likely make a better idea about the topic. BTW, feel free to assign #4384 to me, in case you wish and have the permissions to do so.

@andreaTP
Copy link
Member

andreaTP commented Sep 7, 2022

Assigned, thanks for volunteering!

@manusa manusa added this to the 6.2.0 milestone Sep 8, 2022
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.

[crd-gen] - AbstractJsonSchema.SchemaPropsOptions.getRequired returns the wrong filed value
3 participants