selling-partner-api icon indicating copy to clipboard operation
selling-partner-api copied to clipboard

Update ShippingService.php

Open simonsolutions opened this issue 1 year ago • 2 comments

RequiresAdditionalSellerInputs is not always present in response, so allow nulled value

simonsolutions avatar Jul 01 '24 18:07 simonsolutions

You edited a file that is auto generated. Have a look at this pull request: https://github.com/jlevers/selling-partner-api/pull/741 I've had a similar issue with a different class. You should add the change to the modifications.json and then regenerate the files.

It's explained in the contributing.md. Else your change would be revoked with the next generation process.

KhorneHoly avatar Jul 02 '24 07:07 KhorneHoly

Thank you @KhorneHoly for stating out that dependency. I changed like in your PR both json files as well. Hope the change is complete in that way?!

simonsolutions avatar Jul 02 '24 11:07 simonsolutions

@simonsolutions this looks good. It looks like you modified the JSON schema file directly and then added the modification to the modifications.json file, which is fine, but I just would like to test the addition to modifications.json by running the commands below, and ensuring that your resources/models/seller/merchant-fulfillment/v0.json and src/Seller/MerchantFulfillmentV0/Dto/ShippingService.php files stay the same:

$ php bin/console schema:refactor --schema merchant-fulfillment
$ php bin/console schema:generate --schema merchant-fulfillment
$ composer lint

jlevers avatar Jul 09 '24 16:07 jlevers

In which configuration do you run these commands, within my project the console command is not found and on a separate folder for the repo the autoload is not found.

simonsolutions avatar Jul 09 '24 17:07 simonsolutions

Are you in the root project directory for your fork of this repo when you run the commands?

jlevers avatar Jul 09 '24 17:07 jlevers

I tried both, my project root and the fork's root directory

simonsolutions avatar Jul 09 '24 17:07 simonsolutions

Can you show me the error you're getting?

jlevers avatar Jul 09 '24 18:07 jlevers

In my project root (this library added)

 There are no commands defined in the "schema" namespace.

  Did you mean this?
      doctrine:schema

and in the library's root:

PHP Warning:  require(/xxxxx/vendor/jlevers/selling-partner-api/bin/../vendor/autoload.php): Failed to open stream: No such file or directory in /xxxxx/vendor/jlevers/selling-partner-api/bin/console on line 3

Warning: require(/xxxxx/vendor/jlevers/selling-partner-api/bin/../vendor/autoload.php): Failed to open stream: No such file or directory in /xxxxx/vendor/jlevers/selling-partner-api/bin/console on line 3
PHP Fatal error:  Uncaught Error: Failed opening required '/xxxxx/vendor/jlevers/selling-partner-api/bin/../vendor/autoload.php' (include_path='.:/opt/homebrew/Cellar/php/8.3.9/share/php/pear') in /xxxxx/vendor/jlevers/selling-partner-api/bin/console:3
Stack trace:
#0 {main}
  thrown in /xxxxx/vendor/jlevers/selling-partner-api/bin/console on line 3

Fatal error: Uncaught Error: Failed opening required '/xxxxx/vendor/jlevers/selling-partner-api/bin/../vendor/autoload.php' (include_path='.:/opt/homebrew/Cellar/php/8.3.9/share/php/pear') in /xxxxx/vendor/jlevers/selling-partner-api/bin/console:3
Stack trace:
#0 {main}
  thrown in /xxxxx/vendor/jlevers/selling-partner-api/bin/console on line 3

simonsolutions avatar Jul 09 '24 18:07 simonsolutions

It looks like you're trying to run the command from inside this library's folder in the vendor/ directory of your project. You need to actually clone this repository, install the dependencies, and make changes there. Trying to contribute to the library from inside the vendor/ folder of your project is not going to work.

Also, without doing that, you can't run the tests, linter, etc, which means that you can't fully check that your changes are valid before you commit them. There's more details on how to contribute in the contributor guide.

jlevers avatar Jul 09 '24 18:07 jlevers

I tested this myself. Merging.

jlevers avatar Aug 05 '24 20:08 jlevers