-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[PHP] [ci skip] Add nullable logic #3493
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
Conversation
thanks for your PR. |
Provide non-nullable fields with responses
The failing client tests show that null values are assigned to attributes.
@macjohnny, do you think that making sure that OAS2 examples are never null, is OK? — Helen of https://stackoverflow.com/a/48114322 More context
then However, when I run
then the logic in mustache template
always leads to |
I think we shouldn't change the OAS2 examples. |
moreover, the default behavior should be to ignore null values to be assigned to non-nullable fields, in order to avoid breaking changes |
Created another pull request #3524 as well because one of the v3 tests wants to create an object which has something like |
Somehow have to know whether OAS3 or OAS2 is being processed.
I haven't found out how to get the info whether OAS3 or OAS2 document is being processed. |
@githubERIK For OAS2, we can use |
Is this PR still relevant or should be closed without merge? |
This PR helped us a lot when we ported the code to the templates. |
@githubERIK are you still planning to work on this? This issue is currently forcing us to build some workarounds for this issue. If you won't work on it anymore, I'm happy to create a new PR with your commits and get this pushed over the finish line! |
@dennisameling, no, I'm not planning to work on this. The biggest obstacle for me was supporting OAS2 (#3493 (comment)); I got OAS3 case working and that was all I needed. It would be awesome if you could create a new PR (feel free to use my commits)! 👍 |
Alright, will try to have a look in the coming weeks! 😊 |
Closed via #12794 |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,4.1.x
,5.0.x
. Default:master
.Master should be 🆗.
@jebentier, @dkarlovi, @mandrean, @jfastnacht, @ackintosh, @ybelenko, @renepardon
Description of the PR
Fix #2199
How to check the outcome
composer require messente/messente-api-php
and given "email", "firstName","lastName", "company", "title", "custom", "custom2","custom3", "custom4" are
nullable:true
check that ...When a request goes out
When a response comes in