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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Fix validation errors for Swagger Open API (#11228)
Matthew Kennedy4bf6dfd438f9
diff --git a/api/docs/v2/storefront/index.yaml b/api/docs/v2/storefront/index.yamlindex cdc5be5848..072a88ed79 100644--- a/api/docs/v2/storefront/index.yaml+++ b/api/docs/v2/storefront/index.yaml@@ -29,7 +29,7 @@ paths:summary: Get an Accounttags:- Account- operationId: Account Information+ operationId: account-informationparameters:- $ref: '#/components/parameters/AccountIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'@@ -94,18 +94,6 @@ paths:state_code: NY'403':$ref: '#/components/responses/403Forbidden'- description: ''- content:- application/json:- schema:- type: object- properties:- '':- type: string- examples:- example-1:- value:- error: You are not authorized to access this page.security:- bearerAuth: []post:@@ -116,7 +104,7 @@ paths:summary: Create an Accounttags:- Account- operationId: Account Creation+ operationId: account-creationrequestBody:required: truecontent:@@ -158,7 +146,7 @@ paths:summary: Update an Accounttags:- Account- operationId: Account Updates+ operationId: account-updatesrequestBody:required: truecontent:@@ -205,7 +193,7 @@ paths:summary: List of Addressestags:- Account- operationId: Addresses list+ operationId: addresses-listresponses:'200':description: Listing user addresses.@@ -222,7 +210,7 @@ paths:summary: Create an Addresstags:- Account- operationId: Create Address+ operationId: create-addressrequestBody:required: truecontent:@@ -248,9 +236,9 @@ paths:description: 'Removes selected Address for the signed in User. It uses soft-delete for addresses with shipments and orders.'tags:- Account- operationId: Remove Address+ operationId: remove-addressparameters:- - $ref: '#/components/parameters/AddressId'+ - $ref: '#/components/parameters/Id'responses:'204':description: Requested Address has been removed from the User Account@@ -264,9 +252,9 @@ paths:summary: Update Addresstags:- Account- operationId: Update Address+ operationId: update-addressparameters:- - $ref: '#/components/parameters/AddressId'+ - $ref: '#/components/parameters/Id'requestBody:required: truecontent:@@ -293,7 +281,7 @@ paths:summary: List of Credit Cardstags:- Account- operationId: Credit Cards list+ operationId: credit-cards-listresponses:'200':description: Listing user credit cards.@@ -310,7 +298,7 @@ paths:name: 'filter[payment_method_id]'schema:type: string- example: 2+ example: "2"description: Filter based on payment method ID- $ref: '#/components/parameters/CreditCardIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'@@ -319,8 +307,9 @@ paths:description: 'Removes selected credit card for the signed in User. It uses soft-delete.'tags:- Account- operationId: Remove Credit Card+ operationId: remove-credit-cardparameters:+ - $ref: '#/components/parameters/Id'- $ref: '#/components/parameters/CreditCardIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'responses:@@ -337,7 +326,7 @@ paths:summary: Get Default Credit Cardtags:- Account- operationId: Default Credit Card+ operationId: default-credit-cardresponses:'200':description: Listing user default credit card.@@ -358,7 +347,7 @@ paths:summary: List of Orderstags:- Account- operationId: Completed Orders+ operationId: completed-ordersresponses:'200':description: Listing user completed orders.@@ -375,13 +364,13 @@ paths:- $ref: '#/components/parameters/PerPageParam'security:- bearerAuth: []- '/api/v2/storefront/account/orders/{number}':+ '/api/v2/storefront/account/orders/{order_number}':get:description: Return the User's completed Ordersummary: Get an Ordertags:- Account- operationId: Completed User Order+ operationId: completed-user-orderresponses:'200':description: Listing user completed order.@@ -397,7 +386,7 @@ paths:- $ref: '#/components/parameters/SparseFieldsParam'security:- bearerAuth: []- '/api/v2/storefront/order_status/{number}':+ '/api/v2/storefront/order_status/{order_number}':get:description: |-Returns placed Order information. This endpoint is useful for fetching Order information for non-signed in Users. This way customers without an account can check their Order status (shipment/paymnet/processing/etc).@@ -406,7 +395,7 @@ paths:summary: Get an Order Statustags:- Order Status- operationId: Order Status+ operationId: order-statusresponses:'200':description: Requested Order information@@ -432,7 +421,7 @@ paths:It is required to create a Cart before adding items to the Cart. After completing the Checkout you will need to create a new Cart.tags:- Cart- operationId: Create Cart+ operationId: create-cartresponses:'201':description: Cart was successfully created@@ -463,7 +452,7 @@ paths:currency: USDstate: carttoken: zdmOIe5GUtZhZdh0zeFv9w1581837294588- email: null+ email: [email protected]display_item_total: $0.00display_ship_total: $0.00display_adjustment_total: $0.00@@ -490,6 +479,45 @@ paths:data: nullshipping_address:data: null+ included:+ - id: "2"+ type: "promotion"+ attributes:+ name: "10% Discount"+ description: "Super discount for you"+ amount: "-22.0"+ display_amount: "$22.00"+ - id: "4"+ type: "user"+ attributes:+ email: "[email protected]"+ - id: "1"+ type: "address"+ attributes:+ firstname: "Bob"+ lastname: "Billerson"+ address1: "1600 Clear View Pkwy"+ address2: "Mountain View"+ city: "LA"+ zipcode: '94043'+ phone: "(+1) 123 456 789"+ state_name: "California"+ state_code: "CA"+ country_name: "United States of America"+ country_iso3: "USA"+ company: null+ - id: "2832"+ type: "shipment"+ attributes:+ number: "H121354"+ free: false+ final_price: '10.0'+ display_final_price: '$10.00'+ tracking_url: 'https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=4123412434%2C'+ state: "shipped"+ shipped_at: '2019-01-02 13:42:12'++parameters:- $ref: '#/components/parameters/CartIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'@@ -501,7 +529,7 @@ paths:Shipments are canceled, payments are voided, then Line Items, Shipments & Payments are deleted.tags:- Cart- operationId: Deletes Cart+ operationId: deletes-cartresponses:'204':description: Current Cart has been removed.@@ -514,7 +542,7 @@ paths:description: Returns contents of the currently used Carttags:- Cart- operationId: Get Cart+ operationId: get-cartresponses:'200':description: Correct cart was returned@@ -542,7 +570,7 @@ paths:```tags:- Cart- operationId: Add Item+ operationId: add-itemresponses:'200':description: Item was added to the Cart successfully@@ -581,7 +609,7 @@ paths:description: Sets the quantity of a given line item. It has to be a positive integer greater than 0.tags:- Cart- operationId: Set Quantity+ operationId: set-quantityresponses:'200':description: New quantity has been successfully set for a requested Line Item@@ -616,7 +644,7 @@ paths:line_item_id: '1'quantity: 5summary: Set Quantity of a Line Item- '/api/v2/storefront/cart/remove_line_item/{line_item_id}':+ '/api/v2/storefront/cart/remove_line_item/{id}':delete:description: |-Removes Line Item from Cart. After removing Item system will re-calculate taxes, promotions, shipments etc.@@ -624,9 +652,9 @@ paths:Updated Cart will be returned.tags:- Cart- operationId: Remove Line Item+ operationId: remove-line-itemparameters:- - $ref: '#/components/parameters/LineItemId'+ - $ref: '#/components/parameters/Id'- $ref: '#/components/parameters/CartIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'responses:@@ -650,7 +678,7 @@ paths:Returns updated Cart.tags:- Cart- operationId: Empty Cart+ operationId: empty-cartresponses:'200':description: Cart has been successfully emptied@@ -672,7 +700,7 @@ paths:description: Applies a coupon code to the Carttags:- Cart- operationId: Apply Coupon Code+ operationId: apply-coupon-coderesponses:'200':description: Coupon code was applied successfully@@ -708,11 +736,11 @@ paths:description: 'Removes a coupon code from the Cart. If no `coupon_code` aprameter is passed , it will remove all applied coupon codes.'tags:- Cart- operationId: Remove Coupon Code+ operationId: remove-coupon-codeparameters:- name: coupon_codein: path- required: false+ required: truedescription: Selected Coupon code for removalschema:type: string@@ -741,7 +769,7 @@ paths:description: Returns a list of Estimated Shipping Rates for Cart. Those are only estimates and can vary from the final shipping rates.tags:- Cart- operationId: Estimate Shipping Rates+ operationId: estimate-shipping-ratesparameters:- name: country_isoin: query@@ -872,7 +900,7 @@ paths:This will complete the Checkout and mark the Order as completed. You cannot execute any operations on this Order anymore via Storefront API. Further operations on the Order are possible via Platform API.tags:- Checkout- operationId: Update Checkout+ operationId: update-checkoutresponses:'200':description: Checkout was updated@@ -929,7 +957,7 @@ paths:description: Goes to the next Checkout steptags:- Checkout- operationId: Checkout Next+ operationId: checkout-nextresponses:'200':description: Checkout transitioned to the next step@@ -957,7 +985,7 @@ paths:description: 'Advances Checkout to the furthest Checkout step validation allows, until the Complete step'tags:- Checkout- operationId: Advance Checkout+ operationId: advance-checkoutresponses:'200':description: Checkout was advanced to the furthest step@@ -985,7 +1013,7 @@ paths:description: Completes the Checkouttags:- Checkout- operationId: Complete Checkout+ operationId: complete-checkoutresponses:'200':description: Checkout was completed@@ -1012,7 +1040,7 @@ paths:description: 'Adds Store Credit payment if the currently signed in User has any available.'tags:- Checkout- operationId: Add Store Credit+ operationId: add-store-creditresponses:'200':description: Store Credit payment created@@ -1037,7 +1065,7 @@ paths:description: Amount of Store Credit to use. As much as possible Store Credit will be applied if no amount is passed.schema:type: string- example: 100+ example: "100"- $ref: '#/components/parameters/CartIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'summary: Add Store Credit@@ -1046,7 +1074,7 @@ paths:description: Remove Store Credit payments if any appliedtags:- Checkout- operationId: Remove Store Credit+ operationId: remove-store-creditresponses:'200':description: Store Credit payment removed@@ -1074,7 +1102,7 @@ paths:description: Returns a list of available Payment Methods for this Checkouttags:- Checkout- operationId: Payment Methods+ operationId: payment-methodsresponses:'200':description: Returns a list of available Payment Methods@@ -1093,7 +1121,7 @@ paths:description: Returns a list of available Shipping Rates for Checkout. Shipping Rates are grouped against Shipments. Each checkout can have multiple Shipments eg. some products are available in stock and will be send out instantly and some needs to be backordered.tags:- Checkout- operationId: Shipping Rates+ operationId: shipping-ratesresponses:'200':description: Returns a list of available Shipping Rates for Checkout@@ -1112,7 +1140,7 @@ paths:description: Returns a list of Products for the current Store.tags:- Products- operationId: Products List+ operationId: products-listparameters:- $ref: '#/components/parameters/FilterByIds'- $ref: '#/components/parameters/FilterBySKUs'@@ -1181,7 +1209,7 @@ paths:schema:$ref: '#/components/schemas/ProductsList'summary: List of Products- '/api/v2/storefront/products/{id}':+ '/api/v2/storefront/products/{product_slug}':get:description: |-Returns Product details. You can use product permalink:@@ -1199,9 +1227,9 @@ paths:**Note** API will attempt a permalink lookup before an ID lookup.tags:- Products- operationId: Show Product+ operationId: show-productparameters:- - $ref: '#/components/parameters/IdOrPermalink'+ - $ref: '#/components/parameters/ProductSlug'- $ref: '#/components/parameters/ProductIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'responses:@@ -3541,7 +3569,7 @@ paths:description: 'Returns a list of Taxons. [Read more about Taxons](https://dev-docs.spreecommerce.org/internals/products#taxons-and-taxonomies)'tags:- Taxons- operationId: Taxons List+ operationId: taxons-listparameters:- $ref: '#/components/parameters/FilterByIds'- $ref: '#/components/parameters/FilterByName'@@ -3575,7 +3603,7 @@ paths:schema:$ref: '#/components/schemas/TaxonsList'summary: List of Taxons- '/api/v2/storefront/taxons/{id}':+ '/api/v2/storefront/taxons/{taxon_permalink}':get:description: |-Returns Taxon details.@@ -3593,9 +3621,9 @@ paths:**Note** API will attempt a permalink lookup before an ID lookup.tags:- Taxons- operationId: Show Taxon+ operationId: show-taxonparameters:- - $ref: '#/components/parameters/IdOrPermalink'+ - $ref: '#/components/parameters/TaxonPermalink'- $ref: '#/components/parameters/TaxonIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'responses:@@ -3863,7 +3891,7 @@ paths:description: Returns a list of all Countriestags:- Countries- operationId: Countries List+ operationId: countries-listresponses:'200':description: Returns a list of all Countries@@ -3890,7 +3918,7 @@ paths:**Note** API will attempt a iso lookup before an iso3 lookup.tags:- Countries- operationId: Show Country+ operationId: show-countryparameters:- $ref: '#/components/parameters/IsoOrIso3'- $ref: '#/components/parameters/CountryIncludeParam'@@ -3910,7 +3938,7 @@ paths:description: Returns the default Country for the application. By default this will be the US.tags:- Countries- operationId: Default Country+ operationId: default-countryparameters:- $ref: '#/components/parameters/CountryIncludeParam'- $ref: '#/components/parameters/SparseFieldsParam'@@ -4032,6 +4060,7 @@ components:description: Country ISO3 codecompany:type: string+ nullable: trueexample: Google Inc.AddressList:required:@@ -4044,12 +4073,11 @@ components:Cart:properties:data:- type: object$ref: '#/components/schemas/CartAttributesWithRelationships'included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/Promotion'- $ref: '#/components/schemas/User'- $ref: '#/components/schemas/Address'@@ -4079,7 +4107,7 @@ components:type: arrayitems:type: object- oneOf:+ anyOf:- $ref: '#/components/schemas/VariantAttributesAndRelationships'- $ref: '#/components/schemas/LineItem'- $ref: '#/components/schemas/Promotion'@@ -4229,6 +4257,7 @@ components:minimum: 0special_instructions:type: string+ nullable: trueexample: Please wrap it as a giftdescription: Message added by the Customercurrency:@@ -4292,7 +4321,7 @@ components:type: arrayitems:type: object- oneOf:+ anyOf:- $ref: '#/components/schemas/PaymentMethod'CreditCard:required:@@ -4300,13 +4329,12 @@ components:- includedproperties:data:- type: object$ref: '#/components/schemas/CreditCardAttributesWithRelationships'included:type: arrayitems:type: object- oneOf:+ anyOf:- $ref: '#/components/schemas/PaymentMethod'CreditCardAttributes:type: object@@ -4347,7 +4375,6 @@ components:type: stringexample: credit_cardattributes:- type: object$ref: '#/components/schemas/CreditCardAttributes'relationships:type: object@@ -4403,7 +4430,7 @@ components:properties:id:type: string- example: 1+ example: "1"type:type: stringdefault: user@@ -4515,7 +4542,7 @@ components:name:type: stringexample: 10% Discount- descriptiom:+ description:type: stringexample: Super discount for youamount:@@ -4534,7 +4561,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/OptionType'- $ref: '#/components/schemas/OptionValue'- $ref: '#/components/schemas/ProductProperty'@@ -4559,7 +4586,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/OptionType'- $ref: '#/components/schemas/OptionValue'- $ref: '#/components/schemas/ProductProperty'@@ -4683,7 +4710,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/ProductAttributesAndRelationships'- $ref: '#/components/schemas/TaxonAttributesAndRelationships'- $ref: '#/components/schemas/TaxonomyAttributesAndRelationships'@@ -4705,12 +4732,15 @@ components:example: Clothes - T-shirtsmeta_title:type: string+ nullable: trueexample: T-shirtsmeta_description:type: string+ nullable: trueexample: 'A list of cool t-shirts 'meta_keywords:type: string+ nullable: trueexample: 't-shirts, cool'left:type: integer@@ -4723,6 +4753,7 @@ components:example: 0depth:type: integer+ nullable: trueexample: 1is_root:type: boolean@@ -4806,7 +4837,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/TaxonAttributesAndRelationships'- $ref: '#/components/schemas/TaxonImage'- $ref: '#/components/schemas/TaxonomyAttributesAndRelationships'@@ -4976,7 +5007,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/Image'- $ref: '#/components/schemas/OptionValue'- $ref: '#/components/schemas/OptionType'@@ -5076,7 +5107,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/State'description: 'Countries within Spree are used as a container for states. Countries can be zone members, and also link to an address. The difference between one country and another on an address record can determine which tax rates and shipping methods are used for the order.[Read more about Countries in Spree](https://dev-docs.spreecommerce.org/internals/addresses#countries)'CountriesList:@@ -5247,7 +5278,7 @@ components:shipped_at:type: stringformat: date-time- example: '2019-01-02 13:42:12 UTC'+ example: '2019-01-02 13:42:12'description: Date when Shipment was being sent from the warehouseShippingRatesList:required:@@ -5261,7 +5292,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/ShippingRate'- $ref: '#/components/schemas/StockLocation'EstimateShippingRatesList:@@ -5340,7 +5371,7 @@ components:included:type: arrayitems:- oneOf:+ anyOf:- $ref: '#/components/schemas/Address'required:- data@@ -5433,11 +5464,11 @@ components:- state_name- country_isoparameters:- AddressId:- name: address_id+ Id:+ name: idin: pathrequired: true- description: Address ID+ description: idschema:type: stringexample: '1'@@ -5456,22 +5487,22 @@ components:```[More information](https://jsonapi.org/format/#fetching-includes)- IdOrPermalink:- name: id+ ProductSlug:+ name: product_slugin: pathrequired: true- description: ID or a permalink+ description: Product Slugschema:type: stringexample: knitted-high-neck-sweater- LineItemId:- name: line_item_id+ TaxonPermalink:+ name: taxon_permalinkin: pathrequired: true- description: Line Item ID+ description: Taxon Permalinkschema:type: string- example: '1'+ example: "categories/women"PageParam:name: pagein: query@@ -5485,9 +5516,9 @@ components:description: Number of requested records per page when paginating collectionschema:type: integer- example: null+ example: 25OrderParam:- name: number+ name: order_numberin: pathrequired: truedescription: Number of Order@@ -5592,7 +5623,7 @@ components:[More information](https://jsonapi.org/format/#fetching-sparse-fieldsets)example: '[cart]=total,currency,number'schema:- type: object+ type: stringresponses:404NotFound:description: Resource not found@@ -5614,3 +5645,12 @@ components:type: stringexample: You are not authorized to access this page.default: You are not authorized to access this page.++tags:+ - name: Account+ - name: Cart+ - name: Checkout+ - name: Countries+ - name: Order Status+ - name: Products+ - name: Taxons