Skip to content

Conversation

func0der
Copy link
Contributor

Suggestion to fix #697.

I do not understand the structure of the tests, so I did not write any. Maybe someone with more experience can add them?

@Korbeil
Copy link
Member

Korbeil commented Jan 26, 2023

Thanks for that fix @func0der ! Could you fix the code styling please ?
Also I would prefer you to add a test on that point, to make it simple you'll need to:

  • Add a model that does not have the nullable attribute and use validation on it to validate that if we pass null, it throw an error ;
  • Add a model with the nullable attribute and use validation to validate that everything is fine.

All theses tests are done in https://github.com/janephp/janephp/blob/next/src/Component/JsonSchema/Tests/Validation/ValidationTest.php this file. And you can add models by updating the schema in the same directory.

@Korbeil
Copy link
Member

Korbeil commented Aug 4, 2023

Hey @func0der, will it be possible to fix coding style and add a test as I described to you on January ?

@func0der func0der force-pushed the 697-minLength-with-nullable branch 4 times, most recently from de4e5c1 to a39070b Compare September 3, 2023 16:21
@func0der
Copy link
Contributor Author

func0der commented Sep 10, 2023

@Korbeil All done :)
Sorry for the long wait.

@Korbeil
Copy link
Member

Korbeil commented Sep 22, 2023

Thanks for the pull request ! Could you rebase and run the cs-fixer ? Also, could add a note about your fix in the CHANGELOG file ?
Thanks ! 🙏

@func0der
Copy link
Contributor Author

func0der commented Sep 23, 2023

The cs issues are not related to my branch and I'd rather not change any of them, because it is not at all related to the issue at hand. This would retrospectively just confuse people.

Please refer to my comment(s) in the changes above.

I'll add the changelog note real quick.

…hValidator.

Use integer so the option value 'allowNull' is actually generated into the client.
@func0der func0der force-pushed the 697-minLength-with-nullable branch from a39070b to 586c8bd Compare September 23, 2023 19:38
@MyZik
Copy link

MyZik commented Nov 15, 2023

Hello @Korbeil ,

we would like to integrate this pull request because without these changes, we cannot generate the correct clients. Could you please review the PR and, if necessary, tag and integrate it?

Best regards

Copy link
Member

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

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

LGTM

@Korbeil Korbeil merged commit 211d523 into janephp:next Nov 17, 2023
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.

minLength > 0 adds NotBlank Constraint without consideration for nullable: true
3 participants