Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Better documentation for API

Matthew Kennedye4110d64f8e4
diff --git a/api/docs/v2/storefront/index.yaml b/api/docs/v2/storefront/index.yaml
index 1f76ec7318..b3a1b8935c 100644
--- a/api/docs/v2/storefront/index.yaml
+++ b/api/docs/v2/storefront/index.yaml
@@ -13642,7 +13642,10 @@ paths:
is_default: true
'/api/v2/storefront/wishlists/{token}':
get:
- description: 'Retrieves the details of an existing wishlist. Supply the unique wishlist token, and the API will return the corresponding wishlist information.'
+ description: |-
+ Retrieves a wishlist using the wishlist token.
+
+ If the wishlist is publicly viewable, the endpoint will return the requested wishlist regardless of the user. If the wishlist is private, only the wishlist owner can access the wishlist.
summary: Retrieve a Wishlist
tags:
- Wishlists
@@ -16723,7 +16726,7 @@ components:
schema:
type: string
example: wished_items.variant
- description: 'Specify the related resources you would like to receive in the `included` section of the response body. You can also retrieve related resources of included resources by using the dot notation, eg. `wished_items.variant`. [More information](https://jsonapi.org/format/#fetching-includes)'
+ description: 'Specify the related resources you would like to receive in the `included` section of the response body. You can also retrieve related resources of included resources by using the dot notation, eg. `wished_items.variant`. [More information](https://jsonapi.org/format/#fetching-includes).'
WishlistIsVariantIncludedParam:
name: is_variant_included
in: query
@@ -16789,9 +16792,9 @@ components:
type: string
WishlistSparseFieldsParam:
in: query
- name: fields
- description: Specify the attributes you would like returned for the given types in the response body.
- example: '[wishlist]=name,is_default'
+ name: 'fields[wishlist]'
+ description: Specify the attributes you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).
+ example: 'name,is_default'
schema:
type: string
responses:
diff --git a/api/spec/requests/spree/api/v2/storefront/wishlists_spec.rb b/api/spec/requests/spree/api/v2/storefront/wishlists_spec.rb
index f687786555..fac79d221e 100644
--- a/api/spec/requests/spree/api/v2/storefront/wishlists_spec.rb
+++ b/api/spec/requests/spree/api/v2/storefront/wishlists_spec.rb
@@ -109,7 +109,7 @@ RSpec.describe Spree::Api::V2::Storefront::WishlistsController, type: :request d
end
context 'when a request is sent by random user with no auth' do
- it 'returns 404 when wishlist is set to is_private: true' do
+ it 'returns 403 when wishlist is set to is_private: true' do
get "/api/v2/storefront/wishlists/#{wishlist_private.token}"
expect(response).to have_http_status(:forbidden)
end