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

Create product through API doc is misleading #4058

Closed
Ruk33 opened this issue May 11, 2021 · 3 comments
Closed

Create product through API doc is misleading #4058

Ruk33 opened this issue May 11, 2021 · 3 comments
Labels
changelog:solidus_api Changes to the solidus_api gem type:bug Error, flaw or fault

Comments

@Ruk33
Copy link

Ruk33 commented May 11, 2021

Create a product by following the documentation here https://solidus.docs.stoplight.io/api-reference/products/create-product is misleading since all the data must be sent through a "product" key (which is not mentioned at all in the documentation and was able to figure it out by looking at the code).

Solidus Version:

NA

To Reproduce

  1. Try to create a product using the API endpoint

Current behavior

The documentation doesn't mention that the product's information must be sent inside of a "product" key, thus, the endpoint fails with a validation error.

Expected behavior

The documentation mentions the product key.

Screenshots

image

image

(Notice how the generated code doesn't include the product key)

Below is how it should be sent
image

(Notice how the info gets sent inside of { "product": { ... } }.

Desktop (please complete the following information):

  • OS: [e.g. iOS] NA
  • Browser [e.g. chrome, safari] NA
  • Version [e.g. 22] NA

Additional context

NA

@kennyadsl
Copy link
Member

Thanks for reporting. I honestly was aware of this due to #3983. I'm started taking a look at how to fix this and I think I'll submit a solution soon.

@kennyadsl kennyadsl added type:bug Error, flaw or fault changelog:solidus_api Changes to the solidus_api gem labels May 13, 2021
@kennyadsl
Copy link
Member

kennyadsl commented May 14, 2021

Tracking down the list of request bodies we need to update in the openapi doc file:

  • product
  • variant
  • payment
  • address
  • line-item
  • checkout
  • order
  • coupon-code
  • shipment
  • zone
  • product-property
  • stock-location
  • taxon
  • taxonomy
  • property
  • image
  • user
  • return-authorization
  • customer-return
  • option-value
  • stock-item

I will submit one or more PR to address this problem.

@kennyadsl
Copy link
Member

This is fixed now for all endpoints. Eg. https://solidus.docs.stoplight.io/api-reference/products/create-product

Thanks for opening the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

2 participants