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

bugfix/InvalidParamTypeProvidedNULL: fixed param apiKey = null in login() method #4399

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eneiasramos
Copy link
Contributor

Description (*)

I got an error using API when applying the last commits to my master branch.

Apparently any API call is generating the error: Invalid param type provided ("null")

Applying the fix the error disappears.

image

image

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Api PageRelates to Mage_Api label Nov 30, 2024
@kiatng
Copy link
Contributor

kiatng commented Nov 30, 2024

I have this commit 41ea3c6 in production, which uses JSON-RPC with basic auth with requests daily, so far nothing bad is reported.

@eneiasramos
Copy link
Contributor Author

@kiatng

Another consideration to do is that apiKey parameter can be null ( apiKey = null ).
However the invalid_request_param fault is triggered in this case.

if (empty($username) || empty($apiKey)) {
            $this->_fault('invalid_request_param');
            return;
        }

So it doesn't make sense that apiKey could be null at this point :)

@sreichel
Copy link
Contributor

Another consideration to do is that apiKey parameter can be null ( apiKey = null ).
However the invalid_request_param fault is triggered in this case.

We should not change methods parameters. Default null does not do anything. Removing it should not change you problem.

@sreichel sreichel closed this Nov 30, 2024
@eneiasramos
Copy link
Contributor Author

@sreichel

Actually the change solved the problem :)

gamuzatech@afec611

image

@sreichel sreichel reopened this Nov 30, 2024
@sreichel
Copy link
Contributor

sreichel commented Dec 7, 2024

@eneiasramos i dont see how doc type should have impact on it ... please check.

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

Successfully merging this pull request may close these issues.

3 participants