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

Fix Request Bodies in API Documentation #4066

Merged

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented May 17, 2021

Description

As raised in #4058 and #3983, we are documenting all our POST/PUT/PATCH API endpoints wrongly.

We need to wrap the JSON of the request body with the object name that we are trying to create/edit. This is a example of the correct format, that we will have after this PR is merged:

 {
  "product": {
    "name": "Product Name",
    "other": "fields"
   }
}

But we are currently documenting all the endpoints to be used as:

{
  "name": "Product Name",
  "other": "fields"
}

Enpoints Fixed:

  • 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

How to test this PR's result:

Create a new project in Stoplight Studio, copy/paste the resulting oas.yml file, which should be available here and watch the preview for the result.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@kennyadsl kennyadsl added changelog:solidus_api Changes to the solidus_api gem Documentation labels May 17, 2021
@kennyadsl kennyadsl self-assigned this May 17, 2021
@kennyadsl kennyadsl marked this pull request as ready for review May 27, 2021 11:23
Copy link
Member

@gmacdougall gmacdougall left a comment

Choose a reason for hiding this comment

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

I trust that you did this right.

@kennyadsl kennyadsl merged commit 8053d89 into solidusio:master May 28, 2021
@kennyadsl kennyadsl deleted the kennyadsl/fix-api-documentation-inputs branch May 28, 2021 09:42
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants